fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int t,s;
  5. scanf("%d",&t); scanf("%ld", &s);
  6. int i,j;
  7. long int moments[s],cookingtime[s],comparison[s];
  8. for(i=0;i<t;i++) {
  9. for(j=0;j<1;j++) {
  10. scanf("%ld", &moments[j]);
  11. comparison[j]=moments[j];
  12. scanf("%ld",&cookingtime[j]); }
  13. for(j=1;j<s;j++) {
  14. scanf("%ld", &moments[j]);
  15. comparison[j]=(moments[j]-moments[j-1]);
  16. scanf("%ld",&cookingtime[j]); }
  17. long int count=0;
  18. for(j=0;j<s;j++) {
  19. if(comparison[j]>=cookingtime[j]) { count++; }
  20. }
  21. printf("%ld \n",count);
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2
4
12 30 60 74
2 15 20 12
37 89 101 156
23 45 16 99
compilation info
prog.c: In function 'main':
prog.c:5:23: warning: format '%ld' expects argument of type 'long int *', but argument 2 has type 'int *' [-Wformat=]
 scanf("%d",&t); scanf("%ld", &s);
                       ^
prog.c:22:1: error: expected declaration or statement at end of input
 } 
 ^
stdout
Standard output is empty