#include<stdio.h>voidfun(int a,int b){
int c;
c = a % b;if(c ==0)printf("%d\n",b);elsefun(b,c);}intmain(){
int n,a,b;scanf("%d",&n);while(n--){
scanf("%d %d",&a,&b);fun(a,b);}return0;}
鸡兔同笼
#include<stdio.h>intmain(){
int n,i,a;scanf("%d",&n);while(n--){
scanf("%d",&a);if(a%2!=0)printf("0 0\n");elseif(a %4!=0)printf("%d %d\n",a/4+1,a/2);elseprintf("%d %d\n",a/4,a/2);}return0;}
按位输出
#include<stdio.h>#include<string.h>char*letter[]={
"zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty","twenty-one","twenty-two","twenty-three","twenty-four","twenty-five","twenty-six","twenty-seven","twenty-eight","twenty-nine","thirty","thirty","thirty-one","thirty-two"};voidchange(char str[],int a[]){
int i;
a[0]=strlen(str);for(i=1;i<=a[0];i++){
a[i]=str[a[0]-i]-'0';}if(str[0]=='-') a[0]--;}intmain(){
int num[100];char str[100];while(scanf("%s",str)!=EOF){
change(str,num);int i