Advertisement
S_h_u_v_r_o

princessmoyna

Nov 29th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int a,b,c,d,e,f,g,h,i,j=1,k=0,x;
  6. scanf("%d",&a);
  7. for(b=0;b<a;b++)
  8. {
  9.  
  10. scanf("%d %d",&c,&d);
  11. int x[c];
  12.  
  13. for(e=0;e<d;e++)
  14. {
  15. printf("Case %d:\n",++j);
  16. scanf("%d",&f);
  17. if(f==1){scanf("%d",&g);x[g]=g;}
  18. else {
  19. k=0;
  20. scanf("%d %d",&h,&i);
  21. for(h;h<=i;h++)
  22. {
  23. if(h==x[h]){k++;}
  24. }
  25. printf("%d\n",k);
  26. }
  27. }
  28.  
  29. }
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement