fork(1) download
  1. #include<stdio.h>
  2. #include<math.h>
  3. using namespace std;
  4. long emi(int,int,int);
  5. long emi(int p,int t,int r)
  6. {
  7. double a=p*r;
  8. double b=pow((1+r),(t*12));
  9. long EMI=a/(1-(1/b));
  10. return EMI;
  11. }
  12. int main()
  13. {
  14. int p;
  15. int T;
  16. long sumA=0,sumB=0;
  17. int n1,t,n2;
  18. float r;
  19. scanf("%d",&p);
  20. scanf("%d",&T);
  21. scanf("%d",&n1);
  22. for(int i=0;i<n1;i++)
  23. {
  24. scanf("%d %f",&t,&r);
  25. sumA+=emi(p,t,r);
  26. }
  27. scanf("%d",&n2);
  28. for(int i=0;i<n2;i++)
  29. {
  30. scanf("%d %f",&t,&r);
  31. sumB+=emi(p,t,r);
  32.  
  33. }
  34. printf("\n%ld ",sumA);
  35. printf("%ld",sumB);
  36. if(sumA<sumB)
  37. printf("Bank A");
  38. else
  39. printf("Bank B");
  40. }
  41.  
  42.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
10000
20
3
5 9.5
10 9.6
5 8.5
3
10 6.9
5 8.5
5 7.9
compilation info
prog.c:3:1: error: unknown type name ‘using’
 using namespace std;
 ^~~~~
prog.c:3:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘std’
 using namespace std;
                 ^~~
stdout
Standard output is empty