#include<stdio.h>#include<string.h>void login(char *p); main(){ char password[10]; login(password); printf("登陆成功!\n"); }void login(char *p){ char a[]="123"; /*密码假设为123*/ do { printf("输入密码:"); gets(p); } while(strcmp(a,p)!=0); }
#include<stdio.h>#include<stdlib.h>typedef struct node{int data;struct node *link;}LNode;LNode *createtail(){ LNode *s,*h,*r; int x,tag; printf("结束符号:"); scanf("%d",&tag); h=(LNode *)malloc(sizeof(LNode)); r=h; printf("输入数据:"); scanf("%d",&x); while(x!=tag) { s=(LNode *)malloc(sizeof(LNo...
#include<stdio.h>#include<stdlib.h>typedef struct node{int data;struct node *link;}LNode;LNode *createfirst(){ LNode *s,*h; int x,tag; h=NULL; printf("结束符号:"); scanf("%d",&tag); printf("输入数据:"); scanf("%d",&x); while(x!=tag) { s=(LNode *)malloc(sizeof(LNode)); s->data=x; s->link=h; h=...
#include<stdio.h>main(){ char ch[26]={0}; int a[26]={0},i; gets(ch); for(i=0;ch[i]!='\0';i++) { if('A'<=ch[i]&&ch[i]<='Z') a[ch[i]-'A']++; if('a'<=ch[i]&&ch[i]<='z') a[ch[i]-'A'-32]++; } for(i=0;i<26;i++) printf("%c:%d\t",i+65,a[i]); printf("\n");}