2019年3月25日

心理魔术

摘要: #include <stdio.h>#include <stdlib.h>#include <time.h>int main(){ int i; char c,gu; srand((unsigned)time(NULL)); c=6; gu=rand()%6+1; for (i=1;i<=100;i 阅读全文

posted @ 2019-03-25 18:09 p201821430005 阅读(99) 评论(0) 推荐(0) 编辑

2019年3月21日

统计单词数

摘要: #include <stdio.h>int main(){ int word,num=0; char ch; printf("input your text:\n"); while((ch=getchar())!='\n') if(ch==' ') word=0; else if(word==0){ 阅读全文

posted @ 2019-03-21 23:43 p201821430005 阅读(128) 评论(0) 推荐(0) 编辑

2019年3月11日

日期的合法性

摘要: #include<stdio.h> int main() { int a,b,c; scanf("%d-%d-%d",&a,&b,&c); if(a < 0 || a > 3000 || c > 31 || c < 0 || b> 12 || b < 0 ) {printf("NO\n");}//判 阅读全文

posted @ 2019-03-11 15:38 p201821430005 阅读(300) 评论(0) 推荐(0) 编辑

2019年3月7日

乘法表

摘要: #include <stdio.h>int main() {int a,b,n;scanf("%d",&n); for(a=1;a<=n;a++){ for(b=a;b<=n;b++){if(b!=n){printf("%d*%d=%d\t",a,b,a*b);} else{printf("%d*% 阅读全文

posted @ 2019-03-07 23:06 p201821430005 阅读(128) 评论(0) 推荐(0) 编辑

2019年2月28日

闰年

摘要: #include <stdio.h>int main() { int year; printf("input a number less than 3000\n"); scanf("%d", &year); if((year % 100 !=0&&year % 4 == 0)||year % 400 阅读全文

posted @ 2019-02-28 23:23 p201821430005 阅读(109) 评论(1) 推荐(0) 编辑

导航