The first method:
#include <stdio.h>#include<string.h>#include<stdlib.h>voidMain () {Charuser[ -],password[ -]; intLen1,len2; printf ("Please enter your user name: \ t"); scanf ("%s",&user); Len1=strlen (user); Len1+=3; printf ("Please enter your password: \ t"); scanf ("%s",&password); Len2=strlen (password); Len2-=2; if((len1-len2) = =0) {printf ("\ n \ nthe successful landing"); System ("Pause"); } Else{printf ("\ n \ nthe password error \ n"); System ("Pause"); }}
The second method:
#include <stdio.h>#include<string.h>#include<stdlib.h>voidMain () {Charuser[ -],password[ -]; Charpass[ -]={0}; Charpacc[]="NULL"; Charpasc[]="SKHRBNC"; printf ("Please enter your user name: \ t"); scanf ("%s",&user); printf ("Please enter your password: \ t"); scanf ("%s",&password); strcat (PASS,PACC); strcat (PASS,PASC); if(strcmp (pass,password) = =0) {printf ("\ n \ nthe successful landing"); System ("Pause"); } Else{printf ("\ n \ nthe password error \ n"); System ("Pause"); }}
The third method:
#include <stdio.h>#include<stdlib.h>#include<string.h>voidMain () {intI,n; Charuser[ +]; intpassword; printf ("User name:"); scanf ("%s", user); printf ("\ n Password:"); scanf ("%d",&password); if(strcmp (User,"Admin")==0) {n=2; for(i=0;i<Ten; i++) {n*=2; } if((password-n) = =0) {printf ("\ n \ nthe successful landing"); } Elseprintf"\ n \ nthe user name or password error \ n"); } Elseprintf"\ n \ nthe user name or password error \ n"); System ("Pause");}
The Fifth method:
#include <stdio.h>#include<string.h>intMainvoid){ Charuser[ -]; Charmima[ -]; inti; intJ; printf ("Please enter user name:"); scanf ("%s",&user); printf ("\ n Please enter your password:"); scanf ("%s",&Mima); for(i=0; I<strlen (user); i++); {User[i]=user[i]^3+3; } for(j=0; J<strlen (Mima); J + +); {Mima[j]= (mima[j]-4)^4; } if(strcmp (user,mima) = =0) {printf ("you're more than Frog frog."); } Elseprintf"you don't have frog frogs."); return 0;}
We can try to write it in other ways.
Several different algorithms for registration code comparison