You are viewing a single comment's thread. Return to all comments →
A simple and perhaps readable solution.. You can use n instead of temp as its just a dummy..
int main() { int n,temp; cin>>temp; while(cin>>n) { if(n<38) cout<<n<<endl; else if(n%5 >= 3) cout<<n+ (5-n%5)<<endl; else cout<<n<<endl; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →
A simple and perhaps readable solution.. You can use n instead of temp as its just a dummy..