Long time no see

This commit is contained in:
2026-02-21 10:47:00 +07:00
parent 0d54fe176e
commit b7df98a55c
198 changed files with 3249 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
gcc -Wall main.c ./func.c -o prog
+10
View File
@@ -0,0 +1,10 @@
Denton,Strong,0,6
Magee,Avila,2,8
Leilani,Wade,2,1
Oren,Guerra,4,5
Nevada,Clayton,4,8
Halee,Lynn,3,8
Jocelyn,Knight,4,6
Patrick,Sullivan,6,6
Cyrus,Barlow,8,1
Matthew,Vaughn,7,4
1 Denton Strong 0 6
2 Magee Avila 2 8
3 Leilani Wade 2 1
4 Oren Guerra 4 5
5 Nevada Clayton 4 8
6 Halee Lynn 3 8
7 Jocelyn Knight 4 6
8 Patrick Sullivan 6 6
9 Cyrus Barlow 8 1
10 Matthew Vaughn 7 4
+35
View File
@@ -0,0 +1,35 @@
#ifndef HEAD
#define HEAD
// INCLUDE
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
// DEFINE
#define MAXSYMB_IN_NAME 15
#define MAXSYMB_IN_SURNAME 20
#define MAXSYMB_IN_CURROW 20 // SHOOD BE >= THAN MAXSYMB* AND CANNOT BE > 255
#define MAXSTUDENTS 10 // SHOOD BE > 255
#define clear wchar_t clear[] = L"\n \033[H\033[J \n"; for(int i = 0;clear[i]!='\0';i++)putwchar(clear[i])
// FUNC
// === output.c ===
void print_menu_main(void);
void print_wich_student(void);
void print_menu_create(char ws);
void print_menu_edit(char ws);
void print_menu_del(char ws);
void print_no_free_space(void);
// === input.c ===
char get_num(void);
void get_row(wchar_t row[]);
// === logic.c ===
#endif
+18
View File
@@ -0,0 +1,18 @@
#include "head.h"
char get_num(void){
char ws;
do{
wchar_t ch; ws = 0;
while((ch=getwchar())>='0'&&ch<='9')
ws = (ws*10) + (ch-'0');
}while(ws==0);
return ws;
}
void get_row(wchar_t row[]){
}
View File
+92
View File
@@ -0,0 +1,92 @@
#include "head.h"
int main(void){
setlocale(LC_ALL, "");
struct structStudentList{
wchar_t _name[MAXSYMB_IN_NAME+1];
wchar_t _surname[MAXSYMB_IN_SURNAME+1];
char age;
char curse;
};
struct structStudentList students[MAXSTUDENTS+1];
char count_acc[MAXSTUDENTS+1];
{
for (int i = 0; i<MAXSTUDENTS;i++)
count_acc[i] = i;
}
{
wchar_t _currrow[MAXSYMB_IN_CURROW+1];
char flag = 0;
do{ // Main Menu
clear;
print_menu_main();
flag = get_num();
char sw = 0;
char status;
switch(flag){
case 1:
{ // Crete acc
if(count_acc[MAXSTUDENTS]==0){
print_no_free_space();
}
else{
print_menu_create(*count_acc);
}
break;
}
case 2:
{ // Edit acc
print_wich_student();
sw = get_num();
if(sw==-1)return 0;
status = 0;
for(int i = 0;i<MAXSTUDENTS;i++){
status = sw == count_acc[i]?1:0;
if(status) break;
}
if(status){
print_acc_not_exist();
}
else{
}
break;
}
case 3:
{ // Del acc
print_wich_student();
sw = get_num();
if(sw==-1)return 0;
status = 0;
for(int i = 0;i<MAXSTUDENTS;i++){
status = sw == count_acc[i]?1:0;
if(status) break;
}
if(status){
print_acc_not_exist();
}
else{
del_acc(sw);
}
break;
}
case 4:
break;
default:
return 0;
}
}while(flag);
}
return 0;
}
+75
View File
@@ -0,0 +1,75 @@
#include "head.h"
void print_menu_main(void){
wchar_t word[] =
L"\n\tМЕНЮ управления учетными запясями студентов\n 1 - Создать учетку\n2 - Редактировать учетку\n3 - Удалить учетку\n4 - Посмотреть все учетки\n";
for(int i = 0;word[i]!='\0';i++){
putwchar(word[i]);
}
}
void print_wich_student(void){
wchar_t word[] =
L"\nВведите № учетной записи: ";
for(int i = 0;word[i]!='\0';i++){
putwchar(word[i]);
}
}
void print_menu_create(char ws){
wchar_t word[] =
L"\n\tМЕНЮ создания учетной записи";
for(int i = 0;word[i]!='\0';i++){
putwchar(word[i]);
}
}
void print_menu_edit(char ws){
wchar_t word[] =
L"\n\tМЕНЮ редактирования учетной записи\n";
for(int i = 0;word[i]!='\0';i++){
putwchar(word[i]);
}
}
void print_menu_del(char ws){
{//Print first part of sentense
wchar_t word[] =
L"\nВы уверенны что хотите удалить учетку № ";
for(int i = 0;word[i]!='\0';i++){
putwchar(word[i]);
}
}
{//Print №
char method = ws>=10?(ws>=100?3:2):1;
char num[3];
for (int i = 0;i<method;i++){
num[i] = ws%10;
ws /= 10;
}
for (int i = method-1;i>=0;i--){
putwchar(num[i]);
}
}
{//Print last part of sentense
wchar_t word2[] =
L" ?\n";
for(int i = 0;word2[i]!='\0';i++){
putwchar(word2[i]);
}
}
}
void print_list(void){
wchar_t word[] =
L"\t";
for(int i = 0;word[i]!='\0';i++){
putwchar(word[i]);
}
}