初学者c语言程序简单的,c语言简单程序---初学者

资源描述:

素数的筛选 include include define N 1000 int mainint argc, char* argv[] { int i,j,num[N]; fori0;i main { int x,s,t,d; scanf“d“, sx60; tx/6060; dx/60/60; printf“d时d分d秒“,d,t,s; } 三个数的交换 include void main { int a,b,c,t; scanf“ddd“, printf“The original numberad,bd,cd\n“,a,b,c; ta,ab,bt; ta,ac,ct; printf“after swapad,bd,cd“,a,b,c; } switch语句的运用 include main { int a,m; printf“please a number“; scanf“d“, switcha/10 { case 10 case 9 m5; break; case 8 m4; break; case 7m3; break; case 6m2; break; defaultm1; } printf“md“,m; } 判断奇数和偶数 include main { int x; printf“Please a number “; scanf“d“, ifx20 printf“this is a oushu“; else printf“this is a jishu“; } 小写改大写,若是大写则不变 include main { char c1,c2; printf“ a letter\n“; scanf“c“, c2 a main { int x,n; printf“please a number“; scanf“d“, n0; whilex0 { xx/10; n; } printf“d“,n; } 输入一个数,判断它是几位数,然后逆序输出 include int main { int num; int len 0; int temp 0; printf“Please a number\n“; scanf“d“, whilenum 100 { temp temp*10num10; len; num num/10; } printf“length d\n“,len; printf“Reverse is d“, temp; } 打印水仙花数 include main { int x, a,b,c; forx100;x main { int sum,i,t; sum1; t1; fori3;i main { float s,t; int n,i,fz,fm; s0; fz2; fm1; printf“Enter n“; scanf“d“, fori1;i main { flo

展开阅读全文

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值