Jhagrut
int main()
1st try
{
int taxp, tipp, itotal;
float ftotal, mc, tip, tax;
scanf("%f%d%d", &mc, &tipp, &taxp);
tip=mc*(float)tipp/100;
tax=mc*(float)taxp/100;
ftotal=mc+tip+tax;
itotal = ftotal;
printf("%d\n", itotal);
return 0;
}
failed for test case
10.25
17
5
2nd try
tip=mc*((float)tipp/100);
tax=mc*((float)taxp/100);
same test case failed
3rd try
int main()
{
int taxp, tipp, itotal,z;
float ftotal, mc, tip, tax, x, y;
scanf("%f%d%d", &mc, &tipp, &taxp);
z=100;
x=(float)tipp/(float)z;
y=(float)taxp/(float)z;
tip=mc*x;
tax=mc*y;
ftotal=mc+tip+tax;
itotal = ftotal;
printf("%d\n", itotal);
return 0;
}
same test case failed
Anonymous
I AM GETTING TLE(Time limit exceeded) IN THE ONLINE JUDGE ,BUT THE CODE WORKS FINE 
. WHAT IMPROVEMENTS CAN BE DONE TO MAKE THE CODE MORE EFFICIENT ?
problem- https://www.codechef.com/SEPT19B/problems/FIBEASY
my solution-
#include <bits/stdc++.h>
using namespace std;
int main() 
{
  int t;
  cin>>t;
  while(t--)
{ 
    int n,i;
    cin>>n;
    int a[n];
    a[0]=0;
    a[1]=1;
 for(i=2;i<n;i++)
 { 
     a[i]=a[i-1]+a[i-2];
     a[i]=a[i]%10;
   
 }
 int j=0;
 int b=n/2;
 while(b--)
 {
     j=0;
     for(i=0;i<n;i++)
 {
    if(i%2!=0)
  {  
      a[j]=a[i];
      j++;
  }
 
 } 
n=j;
 }
 cout<<a[0];
}
return 0;
}
Deni
Hi guys, if i Need to create a std::function<void()> with void(...) with infinite types i get an error like:
void f(int m){
}
void r(std::function<void(...)> n){
}
int main(){
r(f);
}
That's the code how its possibile to solve this?