摘要: 1 #include 2 #include 3 #include 4 struct student //定义结构体 5 { 6 char name[7]; //姓名 7 int number; //号码 8 }student,student1; 9 void menu() //显示栏 10 { 11 printf("*******... 阅读全文
posted @ 2017-01-06 17:39 legenda 阅读(2417) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #define N 3 6 #define LEN sizeof(struct grade) 7 struct grade 8 { 9 char no[7]; 10 int score; 11 struct grade *next; 12 }; 13 struct... 阅读全文
posted @ 2017-01-05 15:37 legenda 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 int main() 3 { 4 int arry[15]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; 5 int n,i,j; 6 scanf("%d",&n); 7 for(i=0;ii;j--) 11 arry[j]=arry[j-1]; 12 ... 阅读全文
posted @ 2017-01-03 22:02 legenda 阅读(1556) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>int substring(char *str,char *str1);//函数原型int main(void){char str[64]={0};char str1[16]={0};int i,j,x;printf("pleas 阅读全文
posted @ 2016-12-25 14:44 legenda 阅读(11934) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main(){ int i=0; while (++i) { if(i==10) break; if(i%3!=1) continue; printf("%d",i); }} 输出147 阅读全文
posted @ 2016-12-25 10:35 legenda 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 辗转相除法最大的用途就是用来求两个数的最大公约数。 用(a,b)来表示a和b的最大公约数。 有定理: 已知a,b,c为正整数,若a除以b余c,则(a,b)=(b,c)。 (证明过程请参考其它资料) 例:求 15750 与27216的最大公约数。 解: ∵27216=15750×1+11466 ∴(1 阅读全文
posted @ 2016-12-24 23:13 legenda 阅读(1128) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int a,b,i=1,temp,lcm; scanf("%d %d",&a,&b); if(a>b) { temp=a; a=b; b=temp; } lcm=b; if(b%a!=0) { while(lcm%a!=0) { lcm=b* 阅读全文
posted @ 2016-12-24 11:41 legenda 阅读(6031) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int i=0,count=0; char a[100]; scanf("%s",a); while(a[i]!='\0') { if((a[i]-'0')%2==0) count+=(a[i]-'0'); i++; } printf("%d 阅读全文
posted @ 2016-12-23 15:12 legenda 阅读(881) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>int main(){ char s1[100],s2[100]; int num1[31],num2[31],len1,len2,i,j; memset(num1,0,sizeof(num1)); memset(num2,0,s 阅读全文
posted @ 2016-12-11 11:11 legenda 阅读(8640) 评论(0) 推荐(0) 编辑
摘要: 转义字符是一种特殊的字符常量。转义字符以反斜线"\"开头,后跟一个或几个字符。转义字符具有特定的含义,不同于字符原有的意义,故称“转义”字符。例如,在前面各例题printf函数的格式串中用到的“\n”就是一个转义字符,其意义是“回车换行”。转义字符主要用来表示那些用一般字符不便于表示的控制代码。 常 阅读全文
posted @ 2016-12-05 23:59 legenda 阅读(515) 评论(0) 推荐(0) 编辑