All pastes #288613 Raw Edit

Miscellany

public c v1 · immutable
#288613 ·published 2006-12-22 12:52 UTC
rendered paste body
/*&#25351;&#23450;&#12373;&#12428;&#12383;&#28436;&#31639;&#12434;&#12377;&#12427;*/#include<stdio.h>int main(){    int num1;    /*1&#12388;&#12417;&#12398;&#20516;*/    int num2;    /*2&#12388;&#12417;&#12398;&#20516;*/    int type;    /*&#28436;&#31639;&#12398;&#31278;&#39006;*/    printf("1&#12388;&#12417;&#12398;&#20516;&#12434;&#20837;&#21147;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;\n");    fflush(stdout);    scanf("%d",&num1);    printf("2&#12388;&#12417;&#12398;&#20516;&#12434;&#20837;&#21147;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;\n");    fflush(stdout);    scanf("%d",&num2);    type = 0;    while(type<2 || type>4) {	printf("&#35336;&#31639;&#26041;&#27861;&#12434;&#30058;&#21495;&#12391;&#25351;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;\n");	printf("&#65297;&#65294;&#36275;&#12375;&#31639;&#12288;&#65298;&#65294;&#24341;&#12365;&#31639;&#12288;&#65299;&#65294;&#25499;&#12369;&#31639;&#12288;&#65300;&#65294;&#21106;&#12426;&#31639;\n");	fflush(stdout);	scanf("%d",&type);	if(type>=1&&type<=4){	    break;	} else {	    printf("&#35336;&#31639;&#26041;&#27861;&#12395;&#12399;&#65297;&#12363;&#12425;&#65300;&#12414;&#12391;&#12398;&#30058;&#21495;&#12434;&#25351;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;\n");	}    }	printf("***&#35336;&#31639;&#32080;&#26524;***\n");	if(type==1){	    printf("%d+%d&#12399;%d\n",num1,num2,num1+num2);	}	else if(type==2){	    printf("%d-%d&#12399;%d\n",num1,num2,num1-num2);	}	else if(type==3){	    printf("%d*%d&#12399;%d\n",num1,num2,num1*num2);	}	else if(type==4){	    printf("%d/%d&#12399;%d&#20313;&#12426;&#12399;%d\n",num1,num2,num1/num2,num1%num2);	}    return 0;}