Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <iostream>
- using std::cin;
- using std::cout;
- using std::endl;
- int i,counter=0;
- int a=4,b,c,d,e,f,g;
- char passwd[6] = "CYWEI",userpw[6];
- char ch[6];
- char change2[10];
- struct student
- {
- char name[10];
- char sex[6];
- int age;
- int chinesegrade;
- } ;
- struct student s[10];
- void show_picture(void) {
- cout<<" EEEEEEEEEEEEEEEE\n";
- cout<<" E E\n";
- cout<<" E E\n";
- cout<<" E 33333 4 4 E\n";
- cout<<" E 3 4 4 E\n";
- cout<<" E 3 4 4 E\n";
- cout<<" E 33333 444444 E\n";
- cout<<" E 3 4 E\n";
- cout<<" E 3 4 E\n";
- cout<<" E 33333 4 E\n";
- cout<<" E E\n";
- cout<<" E E343434 E\n";
- cout<<" E E\n";
- cout<<" E E\n";
- cout<<" E E\n";
- cout<<" EEEEEEEEEEEEEEEE\n";
- cout<<" 111111\n";
- cout<<" 111111\n";
- cout<<" 3 11 4\n";
- cout<<" 3 11 4\n";
- cout<<" 33311444\n";
- cout<<" 11\n";
- cout<<" 11\n";
- cout<<" 11\n";
- cout<<" 11\n";
- cout<<" 11\n";
- cout<<" 111\n";
- cout<<" 11 11\n";
- cout<<" 11 11\n";
- cout<<"\n";
- cout<<"I am E1B34\n";
- system("PAUSE");
- }
- int main(void) {
- do {
- cout << "±K½X\n";
- cout << "½Ð¿é¤J±K½X:";
- gets(userpw);
- if (strcmp(passwd,userpw) != 0)
- {
- ++counter;
- cout<<"±K½X¿ù½Ð«¿é¤J";
- if(counter==4)
- {
- cout<<"±K½X¿ù¤T¦¸°h¥X";
- system ("PAUSE");
- system ("CLS");
- return 0;
- }
- }
- } while(strcmp(passwd,userpw) != 0);
- system("pause");
- system("CLS");
- show_picture();
- while(1) { //°j°é
- cout<<"********************************************************\n";
- cout<<" a-·s¼W¤@µ§¾Ç¥Í¸ê®Æ \n";
- cout<<" b-¦C¥X¥Ø«e¨t²Î¤ºªº¸ê®Æ \n";
- cout<<" c-§ä¬Y¤@µ§¾Ç¥Í¸ê®Æ \n";
- cout<<" d-§R°£¬Y¤@µ§¾Ç¥Í¸ê®Æ \n";
- cout<<" e-¤@°ê¤å¦¨ÁZ°µ±Æ§Ç \n";
- cout<<" g-µ²§ôµ{¦¡ \n";
- cout<<"********************************************************\n";
- scanf("%c", &i);
- system("cls");
- switch(i)
- {
- case 'a':
- cout<<"¿é¤J¸ê®Æ";
- cout<<"©m¦W";
- cin>>s[a].name;
- cout<<"©Ê§OBOY / GIRL";
- cin>>s[a].sex;
- cout<<"¦~¬ö";
- cin >> s[a].age;
- cout<<"°ê¤å¦¨ÁZ";
- cin >> s[a].chinesegrade;
- a++;
- break;
- case 'b':
- strcpy(s[1].name, "a");
- strcpy(s[2].name, "b");
- strcpy(s[3].name, "c");
- strcpy(s[1].sex, "b");
- strcpy(s[2].sex, "g");
- strcpy(s[3].sex, "B");
- s[1].age = 19;
- s[2].age = 19;
- s[3].age = 19;
- s[1].chinesegrade = 40;
- s[2].chinesegrade = 70;
- s[3].chinesegrade = 20;
- for(b=1;b<a;b++)//¥Î°j°é§â¨t²Î¤º¦³ªº¾Ç¥Í¸ê®Æ¥þ¿é¥X
- {
- cout<<"©m¦W"<<s[b].name;
- cout<<"©Ê§O"<<s[b].sex;
- cout<<"¦~¬ö"<<s[b].age;
- cout<<"¦¨ÁZ"<<s[b].chinesegrade;
- }
- system("pause");
- break;
- case 'c':
- cin>>c;
- cout<<"©m¦W"<<s[c].name;
- cout<<"©Ê§O"<<s[c].sex;
- cout<<"¦~¬ö"<<s[c].age;
- cout<<"¦¨ÁZ"<<s[c].chinesegrade;
- system("pause");
- break;
- case 'd':
- int h;
- cin>>h;
- strcpy(s[h].name,s[11].name);
- strcpy(s[h].sex,s[11].sex);
- s[h].age=s[11].age;
- s[h].chinesegrade=s[11].chinesegrade;
- for(b=1;b<a;b++)
- {
- cout<<"©m¦W"<<s[b].name;
- cout<<"©Ê§O"<<s[b].sex;
- cout<<"¦~¬ö"<<s[b].age;
- cout<<"¦¨ÁZ"<<s[b].chinesegrade;
- }
- system("pause");
- break;
- case 'e':
- for(e=1;e<a;e++)
- {
- for(f=1;f<e;f++)
- {
- if(s[f].chinesegrade>s[f+1].chinesegrade)
- {
- s[11]=s[f];
- s[f]=s[f+1];
- s[f+1]=s[11];
- }
- }
- }
- for(b=1;b<a;b++)
- {
- cout<<"©m¦W:"<<s[b].name<<endl;
- cout<<"©Ê§O:"<<s[b].sex<<endl;
- cout<<"¦~¬ö:"<<s[b].age<<endl;
- cout<<"¦¨ÁZ:"<<s[b].chinesegrade;
- }
- system("pause");
- break;
- case 'g'://¿ï³æd
- system("pause");//¼È°±
- return 0;//µ²§ô
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement