fork download
  1. #include <iostream>
  2. #include<stdio.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int h,m,t,i,a[19]={1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77,88,99};
  7. int b[100][2];
  8. b[1]=[1,11];
  9. b[2]=[2,22];
  10. b[3]=[3,33];
  11. b[4]=[4,44];
  12. b[5]=[5,55];
  13. b[6]=[6,66];
  14. b[7]=[7,77];
  15. b[8]=[8,88];
  16. b[9]=[9,99];
  17. b[11]=[1,11];
  18. b[22]=[2,22];
  19. b[33]=[3,33];
  20. b[44]=[4,44];
  21. b[5]=[5,55];
  22. b[66]=[6,66];
  23. b[77]=[7,77];
  24. b[88]=[8,88];
  25. b[99]=[9,99];
  26.  
  27. cin>>t;
  28. while(t--)
  29. {
  30. int cnt=0,j;
  31. cin>>h>>m;
  32. for(i=0;a[i]<h;i++)
  33. {
  34. for(j=0;j<2;j++)
  35. {
  36. if(m>b[a[i]])cnt++;
  37. }
  38. }
  39. cnt++;
  40. printf("%d\n",cnt);
  41. }
  42. return 0;
  43. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
6
24 60
34 50
10 11
10 12
11 11
1 1
compilation info
prog.cpp: In function 'int main()':
prog.cpp:8:8: error: expected identifier before numeric constant
  b[1]=[1,11];
        ^
prog.cpp:8:9: error: expected ']' before ',' token
  b[1]=[1,11];
         ^
prog.cpp: In lambda function:
prog.cpp:8:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:8:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:8:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[1]=[1,11];
      ^
prog.cpp:9:8: error: expected identifier before numeric constant
  b[2]=[2,22];
        ^
prog.cpp:9:9: error: expected ']' before ',' token
  b[2]=[2,22];
         ^
prog.cpp: In lambda function:
prog.cpp:9:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:9:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:9:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[2]=[2,22];
      ^
prog.cpp:10:8: error: expected identifier before numeric constant
  b[3]=[3,33];
        ^
prog.cpp:10:9: error: expected ']' before ',' token
  b[3]=[3,33];
         ^
prog.cpp: In lambda function:
prog.cpp:10:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:10:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:10:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[3]=[3,33];
      ^
prog.cpp:11:8: error: expected identifier before numeric constant
  b[4]=[4,44];
        ^
prog.cpp:11:9: error: expected ']' before ',' token
  b[4]=[4,44];
         ^
prog.cpp: In lambda function:
prog.cpp:11:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:11:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:11:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[4]=[4,44];
      ^
prog.cpp:12:8: error: expected identifier before numeric constant
  b[5]=[5,55];
        ^
prog.cpp:12:9: error: expected ']' before ',' token
  b[5]=[5,55];
         ^
prog.cpp: In lambda function:
prog.cpp:12:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:12:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:12:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[5]=[5,55];
      ^
prog.cpp:13:8: error: expected identifier before numeric constant
  b[6]=[6,66];
        ^
prog.cpp:13:9: error: expected ']' before ',' token
  b[6]=[6,66];
         ^
prog.cpp: In lambda function:
prog.cpp:13:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:13:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:13:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[6]=[6,66];
      ^
prog.cpp:14:8: error: expected identifier before numeric constant
  b[7]=[7,77];
        ^
prog.cpp:14:9: error: expected ']' before ',' token
  b[7]=[7,77];
         ^
prog.cpp: In lambda function:
prog.cpp:14:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:14:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:14:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[7]=[7,77];
      ^
prog.cpp:15:8: error: expected identifier before numeric constant
  b[8]=[8,88];
        ^
prog.cpp:15:9: error: expected ']' before ',' token
  b[8]=[8,88];
         ^
prog.cpp: In lambda function:
prog.cpp:15:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:15:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:15:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[8]=[8,88];
      ^
prog.cpp:16:8: error: expected identifier before numeric constant
  b[9]=[9,99];
        ^
prog.cpp:16:9: error: expected ']' before ',' token
  b[9]=[9,99];
         ^
prog.cpp: In lambda function:
prog.cpp:16:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:16:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:16:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[9]=[9,99];
      ^
prog.cpp:17:9: error: expected identifier before numeric constant
  b[11]=[1,11];
         ^
prog.cpp:17:10: error: expected ']' before ',' token
  b[11]=[1,11];
          ^
prog.cpp: In lambda function:
prog.cpp:17:10: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:17:10: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:17:7: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[11]=[1,11];
       ^
prog.cpp:18:9: error: expected identifier before numeric constant
  b[22]=[2,22];
         ^
prog.cpp:18:10: error: expected ']' before ',' token
  b[22]=[2,22];
          ^
prog.cpp: In lambda function:
prog.cpp:18:10: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:18:10: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:18:7: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[22]=[2,22];
       ^
prog.cpp:19:9: error: expected identifier before numeric constant
  b[33]=[3,33];
         ^
prog.cpp:19:10: error: expected ']' before ',' token
  b[33]=[3,33];
          ^
prog.cpp: In lambda function:
prog.cpp:19:10: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:19:10: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:19:7: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[33]=[3,33];
       ^
prog.cpp:20:9: error: expected identifier before numeric constant
  b[44]=[4,44];
         ^
prog.cpp:20:10: error: expected ']' before ',' token
  b[44]=[4,44];
          ^
prog.cpp: In lambda function:
prog.cpp:20:10: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:20:10: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:20:7: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[44]=[4,44];
       ^
prog.cpp:21:8: error: expected identifier before numeric constant
  b[5]=[5,55];
        ^
prog.cpp:21:9: error: expected ']' before ',' token
  b[5]=[5,55];
         ^
prog.cpp: In lambda function:
prog.cpp:21:9: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:21:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:21:6: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[5]=[5,55];
      ^
prog.cpp:22:9: error: expected identifier before numeric constant
  b[66]=[6,66];
         ^
prog.cpp:22:10: error: expected ']' before ',' token
  b[66]=[6,66];
          ^
prog.cpp: In lambda function:
prog.cpp:22:10: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:22:10: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:22:7: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[66]=[6,66];
       ^
prog.cpp:23:9: error: expected identifier before numeric constant
  b[77]=[7,77];
         ^
prog.cpp:23:10: error: expected ']' before ',' token
  b[77]=[7,77];
          ^
prog.cpp: In lambda function:
prog.cpp:23:10: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:23:10: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:23:7: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[77]=[7,77];
       ^
prog.cpp:24:9: error: expected identifier before numeric constant
  b[88]=[8,88];
         ^
prog.cpp:24:10: error: expected ']' before ',' token
  b[88]=[8,88];
          ^
prog.cpp: In lambda function:
prog.cpp:24:10: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:24:10: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:24:7: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[88]=[8,88];
       ^
prog.cpp:25:9: error: expected identifier before numeric constant
  b[99]=[9,99];
         ^
prog.cpp:25:10: error: expected ']' before ',' token
  b[99]=[9,99];
          ^
prog.cpp: In lambda function:
prog.cpp:25:10: error: expected '{' before ',' token
prog.cpp: In function 'int main()':
prog.cpp:25:10: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
prog.cpp:25:7: error: incompatible types in assignment of 'main()::<lambda()>' to 'int [2]'
  b[99]=[9,99];
       ^
prog.cpp:36:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     if(m>b[a[i]])cnt++;
                ^
stdout
Standard output is empty