随笔分类 -  C

数据结构实验10——稀疏矩阵
摘要:#include #include #define Num 125typedef struct Triple{ int i,j; int e;}Triple;typedef struct TS{ Triple data[Num]; int mu,nu,tu;}TS;void ... 阅读全文
posted @ 2015-01-27 10:17 赛亚人 阅读(349) 评论(0) 推荐(1)
数据结构实验9——串
摘要:#include #include #define Num 255typedef struct String{ char ch[Num]; int len;}String;void StrAssign(String *T,char *s){ int i=0; while(s[... 阅读全文
posted @ 2015-01-26 20:58 赛亚人 阅读(181) 评论(0) 推荐(0)
online_judge_1178
摘要:#include #include #define M 1000int size;typedef struct Fushu{ int a; int b;}Fushu;void fupop(Fushu *c){ int i,t=0; int max=c[0].a*c[0].a+... 阅读全文
posted @ 2015-01-26 17:43 赛亚人 阅读(123) 评论(0) 推荐(0)
Reversing Linked List (25)
摘要:#include#includetypedef struct Node{ int curadd; int data; int nextadd;}Node;int main(){ int n,k,firstadd,i,num,j; Node *a,temp; int c; while(scanf("%... 阅读全文
posted @ 2015-01-25 22:59 赛亚人 阅读(183) 评论(0) 推荐(0)
online_judge_1177
摘要:#include #include void Reverse(char *str,int low,int high){ char e; while(low<high) { e=str[low]; str[low]=str[high]; st... 阅读全文
posted @ 2015-01-25 22:45 赛亚人 阅读(117) 评论(0) 推荐(0)
平面向量加法(10)
摘要:#includetypedef struct X_L{ double x; double y;}X_L;int main(){ X_L v1,v2; double a,b; while(scanf("%lf%lf%lf%lf",&v1.x,&v1.y,&v2.x,&v2.y)!=EOF) { a=... 阅读全文
posted @ 2015-01-25 16:29 赛亚人 阅读(145) 评论(0) 推荐(0)
字符串循环左移(20)
摘要:#include#includevoid reverse(char *s,int low,int high){ char t; while(low<high) { t=*(s+low); *(s+low)=*(s+high); *(s+high)=t; low++; high--; }}i... 阅读全文
posted @ 2015-01-25 16:04 赛亚人 阅读(225) 评论(0) 推荐(0)
字符串逆序(15)
摘要:#include#includeint main(){ char str[81],e; int i,len; while(gets(str)!=NULL) { len=strlen(str); for(i=0;i<len/2;i++) { e=str[i]; str[i]=str[le... 阅读全文
posted @ 2015-01-25 14:43 赛亚人 阅读(135) 评论(0) 推荐(0)
删除字符串中的子串(20)
摘要:#include#includeint issubstring(char *s1,char *s2){ int i=0,j; int len2=strlen(s2); while(s1[i+len2-1]!='\0') { for(j=0;s2[j]!='\0';j++) if(s1[i+j]... 阅读全文
posted @ 2015-01-25 14:35 赛亚人 阅读(191) 评论(0) 推荐(0)
在字符串中查找指定字符(15)
摘要:#includeint main(){ char e,str[80]; int i; while(gets(str)!=NULL) { e=getchar(); if(e=='\n') scanf("%c",&e); i=0; while(str[i]!='\0'){ if(str[i]... 阅读全文
posted @ 2015-01-25 13:39 赛亚人 阅读(164) 评论(0) 推荐(0)
说反话 (20)
摘要:#includevoid output(char *str){ int i=0; int j; while(str[i]!=' '&&str[i]!='\0') i++; if(str[i]==' ') output(str+i+1); if(str[i]==' ') printf(" "); fo... 阅读全文
posted @ 2015-01-25 13:26 赛亚人 阅读(112) 评论(0) 推荐(0)
组个最小数 (20)
摘要:#includeint main(){ int a[10]; int i,j; while(~scanf("%d",&a[0])) { for(i=1;i0){ printf("%d",i); a[i]--; break; } for(i=0;i<10;i++) for... 阅读全文
posted @ 2015-01-25 13:07 赛亚人 阅读(118) 评论(0) 推荐(0)
求矩阵的局部极大值(15)
摘要:#include#includeint main(){ int m,n,i,j; int count; int **a; while(~scanf("%d%d",&m,&n)) { if(m20||n>20) continue; count=0; a=(int **)malloc(m*size... 阅读全文
posted @ 2015-01-25 12:10 赛亚人 阅读(530) 评论(0) 推荐(0)
求矩阵的局部极大值(15)
摘要:#include#includeint main(){ int m,n,i,j; int count; int **a; while(~scanf("%d%d",&m,&n)) { if(m20||n>20) continue; count=0; a=(int **)malloc(m*size... 阅读全文
posted @ 2015-01-25 11:59 赛亚人 阅读(663) 评论(0) 推荐(0)
08-1. 求一批整数中出现最多的个位数字(20)
摘要:#include#includeint main(){ int n,i,max; int *a; int b[10]; while(~scanf("%d",&n)) { for(i=0;imax) max=b[i]; printf("%d:",max); for(i=0;i<10;i++) ... 阅读全文
posted @ 2015-01-25 11:38 赛亚人 阅读(383) 评论(0) 推荐(0)