Solution for TEST

#include<stdio.h>
int main(void){
int a,i=0;
do{
scanf("%d",&a);
if(a!=42)
printf("\n%d",a);
}
while(a!=42);
return 0;
}
Solution for FCTRL
int main() {
int a;
scanf("%d",&a);
while(a--) {
int r,c,x=0,p=1;
scanf("%d",&c);
do{
x += (r = c/(p*=5));}
while(r);
printf("%d\n",x);
}
return 0;
}
Solution ADDREV
#include<iostream>
using namespace std;
int f(int n){
int s=0,a;
while(n!=0){
a=n%10;
s=s*10+a;
n=n/10;
}
return s;
}
int main(){
int n,c,d,i,x[10000][2];
cin>>n;
for(i=0;i<n;i++){
cin>>x[i][0];
cin>>x[i][1];
}
for(i=0;i<n;i++)
{
c=f(x[i][0]);
d=f(x[i][1]);
cout<<f((c+d))<<"\n";
}
return 0;
}

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.