Advertisement
huutho_96

quản lý sinh viên

Dec 23rd, 2014
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.77 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <Windows.h>
  4. #include <conio.h>
  5. #include <iostream>
  6. #include <fstream>
  7. #include <iomanip>
  8. using namespace std;
  9. struct diem{
  10. float gk1, ck1, tb1, gk2, ck2, tb2;
  11. float hk1, hk2, cn;
  12. };
  13. struct ketqua{
  14. diem mon[10];
  15. float tbm;
  16. int xeploai;
  17. };
  18. struct sinhvien{
  19. char ten[31];
  20. char namsinh[5];
  21. char cmnd[15];
  22. char sdt[15];
  23. char diachi[31];
  24. char lop[15];
  25. char mssv[9];
  26. int gioi, kha, tb, yeu;
  27. ketqua ketquasv;
  28. };
  29. void xeploai1(sinhvien sv[], int n, int somon, int &gioi, int &kha, int &tb, int &yeu);
  30. void nhapdiem(sinhvien &sv, int n)
  31. {
  32. int i;
  33. for (i = 1; i <= n; i++)
  34. {
  35. printf("\tMon %d: \n", i);
  36. printf("\t\tHoc ki 1:\n");
  37. printf("\t\t\tDiem thi giua ki: "); scanf_s("%f.\n", &sv.ketquasv.mon[i].gk1);
  38. printf("\t\t\tDiem thi cuoi ki: "); scanf_s("%f.\n", &sv.ketquasv.mon[i].ck1);
  39. sv.ketquasv.mon[i].hk1 = sv.ketquasv.mon[i].gk1 * 0.3 + sv.ketquasv.mon[i].ck1 * 0.7;
  40. printf("\n\t\tHoc ki 2:\n");
  41. printf("\t\t\tDiem thi giua ki: "); scanf_s("%f.\n", &sv.ketquasv.mon[i].gk2);
  42. printf("\t\t\tDiem thi cuoi ki: "); scanf_s("%f.\n", &sv.ketquasv.mon[i].ck2);
  43. sv.ketquasv.mon[i].hk2 = sv.ketquasv.mon[i].gk2 * 0.3 + sv.ketquasv.mon[i].ck2 * 0.7;
  44. sv.ketquasv.mon[i].cn = (sv.ketquasv.mon[i].hk1 + sv.ketquasv.mon[i].hk2) / 2;
  45. }
  46. sv.ketquasv.tbm = 0;
  47. for (i = 1; i <= n; i++)
  48. sv.ketquasv.tbm += sv.ketquasv.mon[i].cn;
  49. sv.ketquasv.tbm = sv.ketquasv.tbm / n;
  50. }
  51. void nhapthongtin(sinhvien &sv, int i, fstream &tt, int &n)
  52. {
  53. system("cls");
  54. scanf_s("%*c");
  55. printf("*********** Phan thong tin sinh vien ***********\n");
  56. printf("Sinh vien thu %d:\n", i);
  57. printf("Ho va ten : "); gets_s(sv.ten);
  58. printf("MSSV : "); gets_s(sv.mssv);
  59. printf("Dia chi : "); gets_s(sv.diachi);
  60. printf("So dien thoai : "); gets_s(sv.sdt);
  61. printf("Lop hoc : "); gets_s(sv.lop);
  62. printf("Nam sinh : "); gets_s(sv.namsinh);
  63. printf("So cmnd : "); gets_s(sv.cmnd);
  64. printf("\n************ Phan diem thi sinh vien ***********\n");
  65. nhapdiem(sv, n);
  66.  
  67. }
  68. void loadtt(sinhvien sv[], int &n, int m)
  69. {
  70. fstream tt;
  71. tt.open("d:/thongtin.dat", ios::in | ios::binary);
  72. tt.read((char *)&n, sizeof(n));
  73. for (int i = 1; i <= n; i++) tt.read((char *)&sv[i], sizeof(sv[i]));
  74. tt.close();
  75. }
  76. void xuatdiem(sinhvien &sv, int n)
  77. {
  78. printf("\t gk1\t ck1\t hk1\t gk2\t ck2\t hk2\t tbm\n");
  79. for (int i = 1; i <= n; i++)
  80. printf("mon %d\t %.1f\t %.1f\t %.1f\t %.1f\t %.1f\t %.1f\t %.1f\t\n", i, sv.ketquasv.mon[i].gk1, sv.ketquasv.mon[i].ck1, sv.ketquasv.mon[i].hk1, sv.ketquasv.mon[i].gk2, sv.ketquasv.mon[i].ck2, sv.ketquasv.mon[i].hk2, sv.ketquasv.mon[i].cn);
  81. printf("\n\n\t\tTrung binh mon ca nam: %.2f", sv.ketquasv.tbm);
  82. }
  83. void xuatthongtin(sinhvien &sv, int i, int n)
  84. {
  85. system("cls");
  86. printf("\n****************** Phan thong tin sinh vien *****************\n");
  87. printf("Sinh vien thu %d:\n", i);
  88. printf("Ho va ten : %s\n", sv.ten);
  89. printf("MSSV : %s\n", sv.mssv);
  90. printf("So CMND : %s\n", sv.cmnd);
  91. printf("Dia chi : %s\n", sv.diachi);
  92. printf("So dien thoai : %s\n", sv.sdt);
  93. printf("Lop hoc : %s\n", sv.lop);
  94. printf("Nam sinh : %s\n", sv.namsinh);
  95. printf("\n******************* Phan diem thi sinh vien *****************\n");
  96. xuatdiem(sv, n);
  97. printf("\n\t\t\tXep Loai: ");
  98. if (sv.ketquasv.xeploai == 4) printf("Gioi");
  99. else if (sv.ketquasv.xeploai == 3) printf("Kha");
  100. else if (sv.ketquasv.xeploai == 2) printf("Trung Binh");
  101. else printf("Yeu");
  102. _getch();
  103. }
  104. void indiem(sinhvien &sv, int n, fstream &in)
  105. {
  106. in << "\n\t\tGK 1\tCK 1\tHK 1\tGK 2\tCK 2\tHK 2\tTBM\n";
  107. for (int i = 1; i <= n; i++)
  108. in << "\tMon " << i << "\t\t" << sv.ketquasv.mon[i].gk1 << "\t" << sv.ketquasv.mon[i].ck1 << "\t" << sv.ketquasv.mon[i].hk1 << "\t" << sv.ketquasv.mon[i].gk2 << "\t" << sv.ketquasv.mon[i].ck2 << "\t" << sv.ketquasv.mon[i].hk2 << "\t" << sv.ketquasv.mon[i].cn << "\t\n";
  109. in << "\n\t\tTrung binh mon ca nam: " << sv.ketquasv.tbm;
  110. }
  111. void inthongtin(sinhvien &sv, int n)
  112. {
  113. fstream in;
  114. in.open("d:/infile.doc", ios::out | ios::app);
  115. in << "\n\n************************ Phan Thong Tin Sinh Vien ***********************\n";
  116. in << "\n\t\tHo va ten\t\t\t: " << sv.ten;
  117. in << "\n\t\tSo CMND\t\t\t: " << sv.cmnd;
  118. in << "\n\t\tNam sinh\t\t\t: " << sv.namsinh;
  119. in << "\n\t\tDia chi\t\t\t: " << sv.diachi;
  120. in << "\n\t\tLop hoc\t\t\t: " << sv.lop;
  121. in << "\n\t\tMSSV\t\t\t\t: " << sv.mssv;
  122. in << "\n\t\tSo dien thoai\t\t: " << sv.sdt;
  123. in << "\n\n\n************************ Phan Diem Thi Sinh Vien ************************\n";
  124. indiem(sv, n, in);
  125. in << "\n\t\t\tXep Loai: ";
  126. if (sv.ketquasv.xeploai == 4) in << "Gioi";
  127. else if (sv.ketquasv.xeploai == 3) in << "Kha";
  128. else if (sv.ketquasv.xeploai == 2) in << "Trung Binh";
  129. else in << "Yeu";
  130. in << "\n\n=========================================================================\n";
  131. in << "=========================================================================\n";
  132. in.close();
  133. }
  134. void gotoxy(int x, int y)
  135. {
  136. HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
  137. COORD position = { x, y };
  138. SetConsoleCursorPosition(hStdout, position);
  139. }
  140. void inbaocao(sinhvien sv[], int n, int somon, int &g, int &k, int &tb, int &y)
  141. {
  142. loadtt(sv, n, somon);
  143. xeploai1(sv, n, somon, g, k, tb, y);
  144. fstream bc;
  145. bc.open("D:/BaoCao.doc", ios::out);
  146. bc << "\t\t\t Cong Hoa Xa Hoi Chu Nghia Viet Nam\n\t\t\t\tDoc Lap - Tu Do - Hanh Phuc\n\t\t\t\t\t\t ***\n \t\t\t\tBAN BAO CAO KET QUA HOC TAP";
  147. bc << "\n\nTen\t\t\t\tLop\t\t\tMSSV\t\t\tTBCN\tXL\n";
  148. for (int i = 1; i <= n; i++)
  149. {
  150. bc << sv[i].ten;
  151. for (int x = 3; x > strlen(sv[i].ten) / 10; x--) bc << "\t";
  152. bc << sv[i].lop << "\t\t" << sv[i].mssv << "\t\t" << sv[i].ketquasv.tbm << "\t";
  153. if (sv[i].ketquasv.xeploai == 4) bc << "Gioi\n";
  154. else if (sv[i].ketquasv.xeploai == 3) bc << "Kha\n";
  155. else if (sv[i].ketquasv.xeploai == 2) bc << "TB\n";
  156. else bc << "Yeu\n";
  157. }
  158. bc << "\n\tTong ket: \n\t+Gioi: " << g << "\tChiem: " << g * 100 / n << "%\n\t+Kha : " << k << "\tChiem: " << k * 100 / n << "%\n\t+TB : " << tb << "\tChiem: " << tb * 100 / n << "%\n\t+Yeu : " << y << "\tChiem: " << y * 100 / n << "%\n";
  159. bc.close();
  160. }
  161. int timsv(sinhvien &sv, char tukhoa[])
  162. {
  163. char s1[31];
  164. char s2[15];
  165. strcpy_s(s2, tukhoa);
  166. _strlwr_s(s2);
  167. int i = 0;
  168. while (i <= (strlen(sv.ten) - strlen(s2)))
  169. {
  170. strncpy_s(s1, sv.ten + i, strlen(s2));
  171. s1[strlen(s2) + 1] = '\0';
  172. _strlwr_s(s1);
  173. if (strcmp(s2, s1) == 0) break;
  174. i++;
  175. }
  176. if (i <= (strlen(sv.ten) - strlen(s2))) return 1;
  177. i = 0;
  178. if (strlen(s2) <= strlen(sv.mssv))
  179. {
  180. while (i <= (strlen(sv.mssv) - strlen(s2)))
  181. {
  182. strncpy_s(s1, sv.mssv + i, strlen(s2));
  183. s1[strlen(s2) + 1] = '\0';
  184. _strlwr_s(s1);
  185. if (strcmp(s2, s1) == 0) break;
  186. i++;
  187. }
  188. if (i <= (strlen(sv.mssv) - strlen(s2))) return 1;
  189. }
  190. return 0;
  191. }
  192. void xephang(sinhvien sv[], int &n, int somon, int stt[])
  193. {
  194. int t, a=0;
  195. loadtt(sv, n, somon);
  196. for (int i = 1; i <= n; i++) stt[i] = i;
  197. for (int i = 1; i <= n; i++)
  198. {
  199. for (int j = 1; j <= n; j++)
  200. {
  201. if (sv[stt[i]].ketquasv.tbm > sv[stt[j]].ketquasv.tbm)
  202. {
  203. t = stt[i];
  204. stt[i] = stt[j];
  205. stt[j] = t;
  206. }
  207. }
  208. }
  209. }
  210. void suathongtin(int n, int somon, int i)
  211. {
  212. fstream tt;
  213. sinhvien sv[11];
  214. loadtt(sv, n, somon);
  215. nhapthongtin(sv[i], i, tt, somon);
  216. cout << "\nSave (s/n)";
  217. int luachon;
  218. luachon = _getch();
  219. if (luachon == 83 || luachon == 115)
  220. {
  221. tt.open("d:/thongtin.dat", ios::out | ios::binary);
  222. tt.write((char *)&n, sizeof(n));
  223. for (i = 1; i <= n; i++) tt.write((char *)&sv[i], sizeof(sv[i]));
  224. tt.flush();
  225. tt.close();
  226. }
  227. else loadtt(sv, n, somon);
  228.  
  229. }
  230. int admin()
  231. {
  232. char pass[15];
  233. int i = 0, dem = 0;
  234. do
  235. {
  236. i = 0;
  237. system("cls");
  238. cout << " ******** NHAP PASS ********\n" << " ";
  239. while ((pass[i] = _getch()) != 13 && i++ < 13) cout << "*";
  240. pass[i] = '\0';
  241. if (strcmp(pass, "HuuTho") == 0) return 1;
  242. else dem++;
  243. } while (dem < 3);
  244. if (dem == 3) return 0;
  245. }
  246. void danhsachsv(sinhvien sv[], int somon)
  247. {
  248. int n, t, a =0;
  249. int stt[11];
  250. fstream tt;
  251. loadtt(sv, n, somon);
  252. tt.open("d:/thongtin.dat", ios::in | ios::binary);
  253. for (int x = 1; x <= n; x++) stt[x] = x;
  254. for (int i = 1; i <= n; i++)
  255. {
  256. for (int j = 1; j <= n; j++)
  257. {
  258. if (i == j) continue;
  259. if (strcmp(sv[stt[i]].ten, sv[stt[j]].ten) > 1)
  260. {
  261. t = stt[i];
  262. stt[i] = stt[j];
  263. stt[j] = t;
  264. }
  265. }
  266. }
  267. do
  268. {
  269. system("cls");
  270. for (int i = 1; i <= n; i++) cout << "\n" << i << ". " << sv[stt[i]].ten;
  271. int i;
  272.  
  273. i = _getch();
  274. i = i - 48;
  275. if (i <= n && i > 0)
  276. {
  277. xeploai1(sv, n, somon, a, a, a, a);
  278. xuatthongtin(sv[stt[i]], stt[i], somon);
  279. cout << "\n\n\t\tEDIT (y/n) ?";
  280. if (_getch() == 121 && n != 0) if (admin() == 1)
  281. {
  282. tt.close();
  283. suathongtin(n, somon, i);
  284. }
  285. else tt.close();
  286. }
  287. } while (_getch() != 27);
  288. }
  289. void xoatt(sinhvien sv[], int &n, int j, int somon)
  290. {
  291. fstream tt;
  292. int i;
  293. loadtt(sv, n, somon);
  294. tt.open("d:/thongtin.dat", ios::out | ios::binary);
  295. n = n - 1;
  296. tt.write((char *)&n, sizeof(n));
  297. for (i = 1; i <= n + 1; i++)
  298. {
  299. if (i != j) tt.write((char *)&sv[i], sizeof(sv[i]));
  300. }
  301. tt.flush();
  302. tt.close();
  303. }
  304. int xeploai(sinhvien &sv, int n, int somon, int &gioi, int &kha, int &tb, int &yeu)
  305. {
  306. int min = 10;
  307. for (int i = 1; i <= somon; i++)
  308. {
  309. if (min > sv.ketquasv.mon[i].hk1) min = sv.ketquasv.mon[i].hk1;
  310. if (min > sv.ketquasv.mon[i].hk2) min = sv.ketquasv.mon[i].hk2;
  311. }
  312. if (sv.ketquasv.tbm < 5) sv.ketquasv.xeploai = 1;
  313. if (sv.ketquasv.tbm >= 5) sv.ketquasv.xeploai = 2;
  314. if (sv.ketquasv.tbm >= 6.5 && min < 5) sv.ketquasv.xeploai = 2;
  315. if (sv.ketquasv.tbm >= 6.5 && min >= 5) sv.ketquasv.xeploai = 3;
  316. if (sv.ketquasv.tbm >= 8 && min >= 5) sv.ketquasv.xeploai = 3;
  317. if (sv.ketquasv.tbm >= 8 && min >= 6.5) sv.ketquasv.xeploai = 4;
  318. if (sv.ketquasv.xeploai == 1) yeu++; else if (sv.ketquasv.xeploai == 2) tb++; else if (sv.ketquasv.xeploai == 3) kha++; else if (sv.ketquasv.xeploai == 4) gioi++;
  319. return 1;
  320. }
  321. void xeploai1(sinhvien sv[], int n, int somon, int &gioi, int &kha, int &tb, int &yeu)
  322. {
  323. gioi = 0; kha = 0; tb = 0; yeu = 0;
  324. for (int x = 1; x <= n; x++)
  325. xeploai(sv[x], n, somon, gioi, kha, tb, yeu);
  326. }
  327. void menu1()
  328. {
  329. printf("\n+***************************** Ghi Thong Tin ****************************+");
  330. printf("\n+------------------------------------------------------------------------+");
  331. printf("\n+ 1. Ghi thong tin chi tiet +");
  332. printf("\n+ 2. Ghi bao cao hoc tap lop +");
  333. printf("\n+------------------------------------------------------------------------+");
  334. printf("\n+ ESC. Thoat +");
  335. printf("\n+------------------------------------------------------------------------+\n");
  336. }
  337. void menu()
  338. {
  339. printf("\n+*************************** Quan Ly Sinh Vien **************************+");
  340. printf("\n+------------------------------------------------------------------------+");
  341. printf("\n+ 1. Bo sung du lieu ve sinh vien +");
  342. printf("\n+ 2. Ghi thong tin ra file +");
  343. printf("\n+ 3. Load thong tin tren bo nho +");
  344. printf("\n+ 4. Tim sv bang tu khoa +");
  345. printf("\n+ 5. Danh sach Sv +");
  346. printf("\n+ 6. Xep hang sinh vien +");
  347. printf("\n+ 7. De suat hoc bong +");
  348. printf("\n+ 8. Sua thong tin sinh vien +");
  349. printf("\n+ 9. Xoa thong tin sinh vien +");
  350. printf("\n+------------------------------------------------------------------------+");
  351. printf("\n+ ESC. Thoat +");
  352. printf("\n+------------------------------------------------------------------------+\n");
  353. }
  354. void main()
  355. {
  356. int g = 0, k = 0, tb = 0, y = 0;
  357. sinhvien sv[11];
  358. int sokt = 0, sodong = 1;
  359. int i, n = 0, somon = 6, stt[10];
  360. int c, luachon; int *mang;
  361. fstream tt, d, hb;
  362. int dem = 0, dem1;
  363. do
  364. {
  365. loadtt(sv, n, somon);
  366. int dem = 0, sothongtin;
  367. system("cls");
  368. menu();
  369. switch (_getch())
  370. {
  371. case 49:
  372. tt.open("D:/thongtin.dat", ios::out | ios::binary);
  373. system("cls");
  374. printf("So sinh vien can nhap thong tin: ");
  375. scanf_s("%d.\n", &c);
  376. n = n + c;
  377. tt.write((char *)&n, sizeof(n));
  378. for (i = n - c + 1; i <= n; i++)
  379. nhapthongtin(sv[i], i, tt, somon);
  380. for (i = 1; i <= n; i++) tt.write((char *)&sv[i], sizeof(sv[i]));
  381. tt.flush();
  382. tt.close();
  383. xeploai1(sv, n, somon, g, k, tb, y);
  384. for (i = 1; i <= n; i++)
  385. xuatthongtin(sv[i], i, somon);
  386. break;
  387. case 50:
  388. xeploai1(sv, n, somon, g, k, tb, y);
  389. do
  390. {
  391. system("cls");
  392. menu1();
  393. do
  394. {
  395. luachon = _getch();
  396. } while (luachon != 49 && luachon != 50 && luachon != 27);
  397. switch (luachon)
  398. {
  399. case 49:
  400. for (i = 1; i <= n; i++) inthongtin(sv[i], somon);
  401. cout << "successful " << "\nOpen file...";
  402. system("d:/infile.doc");
  403. break;
  404. case 50:
  405. inbaocao(sv, n, somon, g, k, tb, y);
  406. cout << "successful " << "\nOpen file...";
  407. system("d:/BaoCao.doc");
  408. break;
  409. default:
  410. break;
  411. }
  412. break;
  413. } while (_getch() != 27);
  414. break;
  415. case 51:
  416. xeploai1(sv, n, somon, g, k, tb, y);
  417. for (i = 1; i <= n; i++)
  418. xuatthongtin(sv[i], i, somon);
  419. break;
  420. case 52:
  421. char tukhoa[15];
  422. c = 0;
  423. system("cls");
  424. cout << "******** Nhap tu khoa tim kiem ********\n";
  425. gets_s(tukhoa);
  426. cout << "\n***** Ket qua tim kiem cho: '" << tukhoa << "' *****\n";
  427. for (i = 1; i <= n; i++) if (timsv(sv[i], tukhoa) == 1) cout << "\n" << i << ". " << sv[i].ten << "\tMSSV: " << sv[i].mssv;
  428. break;
  429. case 53:
  430. system("cls");
  431. xeploai1(sv, n, somon, g, k, tb, y);
  432. cout << "******** Danh sach: ********\n";
  433. danhsachsv(sv, somon);
  434. break;
  435. case 54:
  436. system("cls");
  437. cout << "******** Xep Hang: ********\n";
  438. xephang(sv, n, somon, stt);
  439. do
  440. {
  441. system("cls");
  442. for (int i = 1; i <= n; i++) cout << i << "." << sv[stt[i]].ten << "\t\tDat: " << sv[stt[i]].ketquasv.tbm << "\n";
  443. int i;
  444. cout << "\nNhap vi thu tren bang xep hang ";
  445. i = _getch();
  446. i = i - 48;
  447. xeploai1(sv, n, somon, g, k, tb, y);
  448. if (i > 0 && i <= n) xuatthongtin(sv[stt[i]], stt[i], somon);
  449. } while (_getch() != 27);
  450. break;
  451. case 55:
  452. dem1 = 1;
  453. xeploai1(sv, n, somon, g, k, tb, y);
  454. xephang(sv, n, somon, stt);
  455. hb.open("D:/Hocbong.doc", ios::out);
  456. hb << "\t\t\t Cong Hoa Xa Hoi Chu Nghia Viet Nam\n\t\t\t\tDoc Lap - Tu Do - Hanh Phuc\n\t\t\t\t\t\t ***\n \t\t\t\t DANH SACH DE SUAT HOC BONG\n\n";
  457. hb << "\n\nTen\t\t\t\tLop\t\t\tMSSV\t\t\tTBCN\n";
  458. while (10 * dem1 < n || dem1 == 1) //rang buoc dieu kien in it nhat 1 nguoi trong truong hop so sv < 10
  459. {
  460. if (sv[stt[dem1]].ketquasv.tbm >= 7)
  461. {
  462. hb << sv[stt[dem1]].ten << "\t\t" << sv[stt[dem1]].lop << "\t\t" << sv[stt[dem1]].mssv << "\t\t" << sv[stt[dem1]].ketquasv.tbm << "\n";
  463. dem1++;
  464. }
  465. else break;
  466. }
  467. hb << "\n\n\t\tCo " << dem1 - 1 << " tren tong so " << n << " sinh vien\n";
  468. hb.close();
  469. system("D:/Hocbong.doc");
  470. cout << "Opening...";
  471. break;
  472. case 56:
  473. int a;
  474. do
  475. {
  476. system("cls");
  477. cout << "Co " << n << "thong tin duoc luu tru" << "\nBan muon chinh sua thong tin bao nhieu nguoi: ";
  478. scanf_s("%d.\n", &a);
  479. } while (a > n);
  480. cout << "Nhap stt nhung nguoi ban muon sua tt (stt trong muc load thong tin)\n";
  481. mang = new int[a];
  482. for (int x = 1; x <= a; x++)
  483. {
  484. cout << "\nstt nguoi thu " << x << " ";
  485. cin >> mang[x];
  486. if (mang[x] > n) x--;
  487. cout << "\n";
  488. }
  489. if (admin() == 1) for (int x = 1; x <= a; x++) suathongtin(n, somon, mang[x]);
  490. xeploai1(sv, n, somon, g, k, tb, y);
  491. break;
  492. case 57:
  493. do
  494. {
  495. system("cls");
  496. cout << "Co " << n << "thong tin duoc luu tru" << "\nBan muon xoa thong tin bao nhieu nguoi: ";
  497. scanf_s("%d.\n", &a);
  498. } while (a > n);
  499. cout << "Nhap stt nhung nguoi ban muon xoa (stt trong muc load thong tin)\n";
  500. mang = new int[a];
  501. for (int x = 1; x <= a; x++)
  502. {
  503. cout << "\nstt nguoi thu " << x << " ";
  504. cin >> mang[x];
  505. if (mang[x] > n) x--;
  506. cout << "\n";
  507. }
  508. if (admin() == 1) for (int x = 1; x <= a; x++) xoatt(sv, n, mang[x], somon);
  509. loadtt(sv, n, somon);
  510. xeploai1(sv, n, somon, g, k, tb, y);
  511. break;
  512. default:
  513. break;
  514. }
  515. } while (_getch() != 27);
  516. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement