• Loading...


0-55:0-49
Accepted
5

View Plain Text

  1. int cal(int n,int i,int f);
  2. void te(int t,int i);
  3.  main()
  4. {
  5.       int t;
  6.       scanf("%d",&t);
  7.       te(t,1);
  8.  
  9. }
  10. void te(int t,int i)
  11. {
  12.      int n,f,c;
  13.      scanf("%d %d",&n,&f);
  14.      c = cal( n,0,f);
  15.      printf("%d\n",c);
  16.      if(t!=i)
  17.      {
  18.           te(t,i+1);
  19.      }
  20.      
  21. }
  22. int cal(int n,int i,int f)
  23. {
  24.     int g;
  25.     if(n!=i)
  26.     {
  27.     if(f>=10000)
  28.     {
  29.                 g = f%10000;
  30.     }
  31.     if((f<10000)&&((f%2)==0))
  32.     {
  33.          g= 2*f + 5;
  34.          
  35.      }
  36.     if((f<10000)&&((f%2)!=0))
  37.      {
  38.          g=f+3;
  39.      }
  40.      return cal(n,i+1,g);
  41.      }
  42.      
  43.      return f;
  44.          
  45.    
  46. }
  47.    


List of Keywords used
    None


Trial 1
Trial 2
Trial 3
Trial 4
Submissions
Multipurpose
1000 pt
You are not logged in
0 / 170

Datatype
1000 pt
You are not logged in
0 / 308

No Bitwise
1000 pt
You are not logged in
0 / 78

Cuboid
1000 pt
You are not logged in
0 / 166

Evaluate the function
1000 pt
You are not logged in
0 / 94

Largest in the set
1000 pt
You are not logged in
0 / 69

2 to N
1000 pt
You are not logged in
0 / 144