#include<stdio.h>#include<stdlib.h>#include<time.h>int main(){ int i; for(i=1;i<=5;i++) { printf("i=%d\n",i); }printf("i最后的值为%d\n",i);return 0;}/* for Read More
posted @ 2016-08-02 17:47 A-inspire Views(133) Comments(0) Diggs(0) Edit
#include<stdio.h>#include<stdlib.h>#include<time.h>int main(){ int num,i,result=1; scanf("%d",&num); for(i=1;i<=num;i++) { result=result*i; } printf(" Read More
posted @ 2016-08-02 17:33 A-inspire Views(246) Comments(0) Diggs(0) Edit
#include<stdio.h>#include<stdlib.h>#include<time.h>int main(){ srand(time(0)); int ich;int num; do { getchar(); num=rand()%100+1; if(num%6==0) { print Read More
posted @ 2016-08-02 17:14 A-inspire Views(239) Comments(0) Diggs(0) Edit
#include<stdio.h>#include<stdlib.h>#include<time.h>int main(){ srand(time(0)); int count=0,thought; int num=rand()%100+1; printf("%d\n",num); do { pri Read More
posted @ 2016-08-02 16:53 A-inspire Views(264) Comments(0) Diggs(0) Edit
#include<stdio.h>int main(){int num,count=0,i=0,ret=0;scanf("%d",&num);while(num>=0){ printf("%d\n",num); num--;} return 0;}/*32 1 0 -1 num--; printf( Read More
posted @ 2016-08-02 16:27 A-inspire Views(999) Comments(0) Diggs(0) Edit
#include<stdio.h>int main(){int num,count=0,i=0,ret=0;scanf("%d",&num);count=num;while(num>1){ num/=2; ret++;}printf("log2 of %d = %d\n",count,ret); r Read More
posted @ 2016-08-02 16:13 A-inspire Views(4232) Comments(0) Diggs(0) Edit
#include<stdio.h>int main(){int num,count=0,i=0;scanf("%d",&num);printf("num++=%d\n",num++);printf("num=%d\n",num);printf("++num=%d\n",++num);printf(" Read More
posted @ 2016-08-02 15:44 A-inspire Views(141) Comments(0) Diggs(0) Edit
#include<stdio.h>int main(){int num,count=0,i=0;scanf("%d",&num);num/=10;count++;while(num>0){ num/=10; count++;}printf("%d\n",count);return 0;}//注意:在 Read More
posted @ 2016-08-02 15:32 A-inspire Views(1528) Comments(0) Diggs(0) Edit
#include<stdio.h>int main(){int score,grade;scanf("%d",&score);grade=score/10;switch (grade){case 10:case 9: printf("A\n"); break;case 8: printf("B\n" Read More
posted @ 2016-08-02 15:14 A-inspire Views(1479) Comments(0) Diggs(0) Edit
#include<stdio.h>int main(){int num;int a,b,c,result,d,result1;scanf("int%d",&num);//scanf 的东西必须是要输入的: 内容!!!a=num/100;b=num%10;c=num%100/10;d=num/10%1 Read More
posted @ 2016-08-02 14:34 A-inspire Views(170) Comments(0) Diggs(0) Edit
#include<stdio.h>int main(){int num;int a,b,c,result,d,result1;scanf("%d",&num);a=num/100;b=num%10;c=num%100/10;d=num/10%10;printf("%d %d %d\n",a,b,c) Read More
posted @ 2016-08-02 14:28 A-inspire Views(2314) Comments(0) Diggs(0) Edit
#include<stdio.h>/*void change(int m,int n){ int t; t=m; m=n; n=t;}*/int main(){//交换两杯水,需要一个空杯子,临时保存作用int a=5;int b=6;int t;//scanf("%d%d",&a,&b);t=a; Read More
posted @ 2016-08-02 14:06 A-inspire Views(470) Comments(0) Diggs(0) Edit
#include<stdio.h> int main(){printf("请分别输入身高的英尺和英寸," "如输入\"5 7\"表示5英尺7英寸:\n");int foot;double inch;scanf("%d %lf",&foot,&inch);printf("身高是%f米。\n",((fo Read More
posted @ 2016-08-02 13:41 A-inspire Views(198) Comments(0) Diggs(0) Edit