hrbust1001Probability One

#include<cstdio>

#include<cstring>

#include<iostream>

#include<algorithm>

usingnamespace std;

int main()

{int n0, cs =0;

while(scanf("%d",&n0)!= EOF && n0 )

{int n1, n2, n3, n4, odd; n1 =3* n0;
if
( n1 %2==0){ odd =0; n2 = n1 /2;

}

else{ odd =1; n2 =(n1 +1)/2;} n3 =3* n2; n4 =(int)(n3 /9); printf("%d. ",++cs);if( odd ){ printf("odd ");}else{ printf("even ");} printf("%d\n", n4);}return0;}
原文地址:https://www.cnblogs.com/sxmcACM/p/3000521.html