My issue
explain sigterm error
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
int noc=0;
while(t--){
int x,y,z;
cin>>x>>y>>z;
int sum;
sum=5*x+10*y;
if(sum>=z){
noc=sum/z;
}
return noc;
}
return 0;
}
Learning course: Basic Math using C++
Problem Link: Chef and Chocolates Practice Problem in - CodeChef
@pranjal54
fixed your code .
Hope u will get it
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int x,y,z;
cin>>x>>y>>z;
int noc=0;
int sum;
sum=5*x+10*y;
if(sum>=z){
noc=sum/z;
}
cout<< noc<<endl;
}
return 0;
}
bro please see my solution, hope this will help
#include <stdio.h>
int main(void)
{
// your code goes here
int t;
scanf("%d",&t);
while(t--)
{
int X,Y,z;
scanf("%d%d%d",&X,&Y,&z);
int d=(X*5)+(Y*10);
int e=d/z;
printf("%d\n",e);
}
return 0;
}