![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
程序
togoodfly
这个作者很懒,什么都没留下…
展开
-
数据链表
#include<stdio.h>#include<malloc.h>typedef char ElemType;typedef struct LNode{ElemType data;struct LNode *next;}LinkList;void InitList (LinkList *&L){L=(LinkList *)malloc(sizeof(LinkList));L->next=NULL;}void CreateListR(Lin原创 2020-10-06 17:31:11 · 183 阅读 · 0 评论 -
自定函数
#include<stdio.h>int sum(int n) {int i;int s=0;for(i=1;i<=n;i++){s+=i;}return s;} int main(void){int s=0;s=sum(100);printf("%d\n",s);s=sum(200);printf("%d\n",s);s=sum(10);prin...原创 2019-11-18 13:35:41 · 320 阅读 · 0 评论 -
循环
#include<stdio.h>int main( ) {int i=1;while(1){printf(“第%d只羊\n”,i);i++;}return 0;}#include<stdio.h>#include<Windows.h>int main( ) {int i=1;while(i<=100){printf(“第%d只羊...原创 2019-11-07 22:43:40 · 110 阅读 · 0 评论 -
交换机管理
#include<stdio.h>#include<string.h>int main( ) {char name[32];char password[16];while(1){ printf("请输入用户名:"); scanf("%s",name); printf("请输入密码:"); scanf("%s",password); if(strcmp(n...原创 2019-11-07 18:44:43 · 396 阅读 · 1 评论 -
字符串的比较
#include<stdio.h>#include<string.h>int main( ) {char str1[32]=“li”;char str2[32];int ret;scanf("%s",str2);ret= strcmp(str1,str2);printf("%d\n",ret);return 0;}#include<stdio....原创 2019-11-07 12:47:16 · 75 阅读 · 0 评论 -
特殊函数用法
#include<stdio.h>#include<string.h>int main( ) {char name[64];int len;gets(name);len=strlen(name);printf("%d\n",len);return 0;}#include<stdio.h>#include<string.h>in...原创 2019-11-05 20:17:28 · 172 阅读 · 0 评论 -
输名字
#include<stdio.h>int main( ) {char name[32];gets(name);printf("%s\n",name);return 0;}#include<stdio.h>int main( ) {char name[8];fgets(name,8,stdin);printf("%s\n",name);return 0...原创 2019-11-05 19:17:51 · 198 阅读 · 0 评论 -
两种输入名字的方法
#include<stdio.h>int main( ) {char name[5];name[0]=‘r’;name[1]=‘o’;name[2]=‘c’;name[3]=‘k’;name[4]=’\0’;printf(“name=%s\n”,name);return 0;}#include<stdio.h>int main( ) {char n...原创 2019-11-05 18:48:47 · 444 阅读 · 0 评论