标签:alt lazy include png 复习 数字 char code 罗马
// ex1.cpp #include <stdio.h> int main(){ int a=5, b=7, c=100, d, e, f; d = a/b*c; e = a*c/b; f = c/b*a; printf("d=%d, e=%d, f=%d\n",d,e,f); return 0; }
#include <stdio.h> int main(){ double x,y; char c1,c2,c3; int a1,a2,a3; scanf("%d%d%d",&a1,&a2,&a3); printf("%d,%d,%d\n",a1,a2,a3); scanf("%c%c%c",&c1,&c2,&c3); printf("%c,%c,%c\n",c1,c2,c3); scanf("%lf,%lf",&x,&y); printf("%lf,%lf\n",x,y); return 0; }
#include <stdio.h> int main(){ char x; x = getchar(); if(x >= ‘0‘ && x <= ‘9‘) printf("%c是数字字符\n",x); else if(x >=‘a‘&&x <=‘z‘) printf("%c是英文字符\n",x); else printf("%c是其他字符\n",x); return 0; }
#include <stdio.h> int main(){ char ans1, ans2; printf("复习了没?(输入y或Y表示复习了,输入n或N表示没复习):"); ans1 = getchar(); getchar(); printf("\n动手敲代码了没?(输入y或Y表示敲了,输入n或N表示木有敲):"); ans2 = getchar(); if((ans1 == ‘y‘||ans1 == ‘Y‘) && (ans2 == ‘y‘||ans2 == ‘Y‘)) printf("\n罗马不是一天建成的:)\n"); else printf("\n罗马不是一天毁灭的。。。\n"); return 0; }
#include <stdio.h> #include <math.h> int main(){ int n; int m; int sum; int q=2; int a=1; scanf("%d",&n); m = pow (q,n); sum = a*(1-m)/(1-q); printf("n=%d时,sum= %d",n,sum); return 0; }
标签:alt lazy include png 复习 数字 char code 罗马
原文地址:https://www.cnblogs.com/zyk2002/p/13934540.html