求更改代码

本文介绍了一个C++程序,包含User、Database、SI、Addfriend和Tabfriend等结构体,实现了用户注册、登录、添加朋友并显示好友列表的功能。代码中展示了基本的数据输入验证和操作。
摘要由CSDN通过智能技术生成
#include <bits/stdc++.h>
using namespace std;
struct User {
    string name;
    string Incode;
    string Nation;
    long long Bornyear;
}UID;
struct Datebase {
    string UID_name, UID_Incode, UID_Nation, UID_Bornyear;
}UD;
struct SI {
    string name, Incode;
}SIU;
struct Addfriend {
    string UID_name, UID_Nation, UID_Bornyear;
}AF;
struct Tabfriend {
    string UID_name, UID_Nation, UID_Bornyear;
}TF;
long long Ucnt = 1, TFCnt = 1;
void signup() {
    cin >> UID.name >> UID.Incode >> UID.Nation >> UID.Bornyear;
    UD[Ucnt].UID_name = UID.name;
    UD[Ucnt].UID_Incode = UID.Incode;
    UD[Ucnt].UID_Nation = UID.Nation;
    UD[Ucnt].UID_Bornyear = UID.Bornyear;
    Ucnt++;
}
void signin() {
    cin >> SIU.name >> SIU.Incode;
    for (long long i = 1; i <= Ucnt; i++) {
        if (SIU.name == UD[i].UID_name && SIU.Incode == UD[i].UID_Incode) {
            cout << "WELCOME" << endl;
            return;
        }
    }
    cout << "PLEASE TRY AGAIN" << endl;
}
void add() {
    cin >> AF.UID_Nation;
    for (long long i = 1; i <= Ucnt; i++) {
        if (UD[i].UID_Nation == AF.UID_Nation) {
            cin >> AF.UID_name;
            if (UD[i].UID_name == AF.UID_name) {
                cin >> AF.UID_Bornyear;
                if (UD[i].UID_Bornyear == AF.UID_Bornyear) {
                    cout << "FOUND:" << endl;
                    cout << UD[i].UID_name << " " << UD[i].UID_Bornyear << endl;
                    TF[TFCnt].UID_name = UD[i].UID_name;
                    TF[TFCnt].UID_Nation = UD[i].UID_Nation;
                    TF[TFCnt].UID_Bornyear = UD[i].UID_Nation;
                    TFCnt++;
                    return;
                }
            }
        }
    }
    cout << "NO FOUND" << endl;
}
void PrintTabfriend() {
    for (long long i = 1; i <= TFCnt; i++) {
        cout << TF[i].UID_name << " " << TF[i].UID_Nation << " " << TF[i].UID_Bornyear << endl;
    }
}
int main() {
	
    return 0;
}

看一下这段代码有什么语法错误,谢谢!!!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值