Pages

Tuesday, August 2, 2011

a058. MOD3


#include
using namespace std;

int main()
{
int many,num;
int remainder0=0,remainder1=0,remainder2=0;

cin>>many;
for(int i=0;i {
int remainder=0;
cin>>num;
remainder = num % 3;

switch ( remainder )
{
case 0 :
remainder0++;
break;
case 1 :
remainder1++;
break;
case 2 :
remainder2++;
break;
default :
break;
}
}
cout< return 0;

}

No comments:

Post a Comment