My issue
include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t–){
int x;
cin>>x;
if(x%10==0){
cout<<x/10<<endl;
}
else if(x%5==0){
cout<<x/5<<endl;
}
else {
cout<<“-1”<<endl;
}
}
return 0;
}
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int x;
cin>>x;
if(x%10==0){
cout<<x/10<<endl;
}
else if(x%5==0){
cout<<x/5<<endl;
}
else {
cout<<"-1"<<endl;
}
}
return 0;
}
Learning course: Algorithmic Problem Solving
Problem Link: https://www.codechef.com/learn/course/klu-problem-solving/KLUPS17/problems/MINCOINS