第一个点不过

P5740 【深基7.例9】最厉害的学生

_Harry_Potter_QAQ @ 2023-07-14 16:17:46

第一个点测试输入数据

第一个点测试输出数据

我的输出: 0 0 0

代码:

#include<bits/stdc++.h>
using namespace std;
struct stu
{
    string n;
    int c,m,e;
}a,ans;
int main() 
{
    int n,max=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a.n>>a.c>>a.m>>a.e;
        if((a.c+a.m+a.e)>(ans.c+ans.m+ans.e)) ans=a;
    }
    cout<<ans.n<<" "<<ans.c<<" "<<ans.m<<" "<<ans.e<<endl;
    return 0;
}

by InversionShadow @ 2023-07-14 16:19:42

长大以后,我要买一台可以看见别人电脑文件的电脑


by _Haoomff_ @ 2023-07-14 16:19:45

@_Harry_Potter_QAQ ans定个初始值试试?


by _Haoomff_ @ 2023-07-14 16:20:19

@ydq1101 我也要,买个买一送一的吧


by lowwarm @ 2023-07-14 16:30:23

@ydq1101 我也要,买个买一送二的吧


by InversionShadow @ 2023-07-14 16:31:56

别吵别吵,长大之后开一个电脑厂吧()


by 编码落寞 @ 2023-07-14 16:55:53

@_Harry_Potter_QAQ

估计测试点可能n=1.加个特判吧


by _Harry_Potter_QAQ @ 2023-07-15 08:59:01

@编码落寞 给你看:

913
pzztktv 0 0 0
yzcuqky 0 0 0
mbwdk 0 0 0
msmszaa 0 0 0
nvzcy 0 0 0
evxllkxq 0 0 0
arczm 0 0 0
digok 0 0 0
eaahuw 0 0 0
zbqcpxod 0 0 0
kgcwuks 0 0 0
igzxzf 0 0 0
slucdmjj 0 0 0
lyvtnjyu 0 0 0
nfrvwn 0 0 0
uteluwns 0 0 0
sdjqp 0 0 0
wdnrhfxf 0 0 0
svqjafyn 0 0 0
vejgtgwe 0 0 0
flkqp 0 0 0
iaeogvf 0 0 0
hyzjk 0 0 0
goujia 0 0 0
plxol 0 0 0
pnzmvgt 0 0 0
pppqd 0 0 0
aqufkd 0 0 0
zxoebwjm 0 0 0
ayebdt 0 0 0
bamxipv 0 0 0
dkwnehd 0 0 0
csmhy 0 0 0
tegfep 0 0 0
cryukauq 0 0 0
ewssncmm 0 0 0
auvenx 0 0 0
dmtyngr 0 0 0
wrmvt 0 0 0
qtava 0 0 0
mptmij 0 0 0
xlzfrb 0 0 0
wbsvjtr 0 0 0
qarepsth 0 0 0
sugywsyx 0 0 0
hvvkenet 0 0 0
pbodti 0 0 0
wtkguy 0 0 0
tukqhdt 0 0 0
cobcuisq 0 0 0
psqdtv 0 0 0
eiujbyze 0 0 0
orauslph 0 0 0
egdcjx 0 0 0
ctnkf 0 0 0
kmnimxi 0 0 0
zhhcwlol 0 0 0
maqxmii 0 0 0
jchnq 0 0 0
wgaxnp 0 0 0
dvwdwf 0 0 0
xrjvlidc 0 0 0
tbpila 0 0 0
vphgg 0 0 0
ikckcxrp 0 0 0
nrbwhbbr 0 0 0
hzsytz 0 0 0
yfejfo 0 0 0
vgawtj 0 0 0
qhvmjnoe 0 0 0
evclid 0 0 0
yqkiaigg 0 0 0
ncyfzgii 0 0 0
izcflejt 0 0 0
xovvochj 0 0 0
netniteh 0 0 0
lqsolqev 0 0 0
xippwa 0 0 0
aymue 0 0 0
hmyyn 0 0 0
imzarm 0 0 0
ikvfa 0 0 0
oyolx 0 0 0
pgmvk 0 0 0
rwtpeisa 0 0 0
aymgbbww 0 0 0
xudws 0 0 0
gwikw 0 0 0
hddif 0 0 0
ntqohu 0 0 0
asspspod 0 0 0
skpou 0 0 0
wjanckxo 0 0 0
rfgim 0 0 0
diwazm 0 0 0
zyxecq 0 0 0
umqwsx 0 0 0
tjocapmy 0 0 0
mbydu 0 0 0
vnmgcp 0 0 0
hdppz 0 0 0
hrdpusm 0 0 0
qkgdggxv 0 0 0
dhuaz 0 0 0
nntqufso 0 0 0
oyzhlz 0 0 0
ilgms 0 0 0
oldcww 0 0 0
mfopubx 0 0 0
slvcbuen 0 0 0
imuku 0 0 0
uokoncz 0 0 0
suuawcq 0 0 0
fwwuwod 0 0 0
rwnnkrv 0 0 0
vdonbae 0 0 0
xzojwpqn 0 0 0
lujrclp 0 0 0
shzssbr 0 0 0
dktriwwg 0 0 0
nutbe 0 0 0
ygnrfswl 0 0 0
wzdghe 0 0 0
qgvin 0 0 0
yrwyijbd 0 0 0
fhfufud 0 0 0
ssnotcxs 0 0 0
hzmsz 0 0 0
rykdw 0 0 0
oogdz 0 0 0
isoeqhrc 0 0 0
ggafarbd 0 0 0
plebuxcq 0 0 0
rcrqvshq 0 0 0
abjuh 0 0 0
wcxrqzc 0 0 0
atrqwhr 0 0 0
rgihroms 0 0 0
bagnyf 0 0 0
wukffyt 0 0 0
vtadzw 0 0 0
baazb 0 0 0
xvqcuk 0 0 0
qzxif 0 0 0
goamzn 0 0 0
xlalsc 0 0 0
pofagtt 0 0 0
perjhjb 0 0 0
etgbi 0 0 0
tfvungmr 0 0 0
ejvtrw 0 0 0
wicxz 0 0 0
dkswiv 0 0 0
oeixrpr 0 0 0
szaod 0 0 0
lwbsmoyy 0 0 0
inedofur 0 0 0
hyzjju 0 0 0
rdmqpqqn 0 0 0
jxnmgb 0 0 0
kfewcdc 0 0 0
hnohqgl 0 0 0
djnpi 0 0 0
funea 0 0 0
uzrogjoj 0 0 0
ujypa 0 0 0
jslfwvi 0 0 0
eytpbc 0 0 0
dozin 0 0 0
pwqcnz 0 0 0
xanmwb 0 0 0
adznmn 0 0 0
zipti 0 0 0
hgtokl 0 0 0
arhweok 0 0 0
dmaxldo 0 0 0
ufhtkdjr 0 0 0
mwoori 0 0 0
kxuxvnd 0 0 0
iykyoq 0 0 0
sozjqv 0 0 0
mimbgjms 0 0 0
vepzezlb 0 0 0
ifgrulbt 0 0 0
ddpuyeul 0 0 0
cnuoivy 0 0 0
bepfr 0 0 0
ugzlalb 0 0 0
vlmrwbvz 0 0 0
soolcdv 0 0 0
wflls 0 0 0
oztmc 0 0 0
wlcth 0 0 0
fxleeqqm 0 0 0
alyhcjd 0 0 0
qjzvds 0 0 0
usvrh 0 0 0
feeou 0 0 0
hrnniwqr 0 0 0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rkzgt 0 0 0
ecrfdcex 0 0 0
pdlyoa 0 0 0
aajljvm 0 0 0
iqownjo 0 0 0
kjayso 0 0 0
ztwgi 0 0 0
nbnpr 0 0 0
wxnur 0 0 0
baywezl 0 0 0
kukbi 0 0 0
vwfryv 0 0 0
jvblhnb 0 0 0
ztfejchn 0 0 0
xyxvhcyh 0 0 0
ylryltt 0 0 0
xcgivahn 0 0 0
rnzshj 0 0 0
xngdq 0 0 0
uauiaqud 0 0 0
zoayigxt 0 0 0
jgpqq 0 0 0
fslbtlou 0 0 0
zrvewu 0 0 0
okfwrer 0 0 0
mcwgu 0 0 0
kusmuw 0 0 0
mqesslk 0 0 0
twlobyan 0 0 0
kcdwfq 0 0 0
cxfbhtst 0 0 0
ptrzy 0 0 0
batwbrg 0 0 0
asyko 0 0 0
amebfwo 0 0 0
ksnaq 0 0 0
cycpy 0 0 0
mbvgxmsj 0 0 0
toxnyyt 0 0 0
xkysrpe 0 0 0
arzmw 0 0 0
zqpsmhl 0 0 0
qyxiain 0 0 0
amncxxi 0 0 0
gmmvp 0 0 0
hcpljqmy 0 0 0
nunvl 0 0 0
afadrub 0 0 0
zzciclgj 0 0 0
kvoyb 0 0 0
zczpy 0 0 0
nicnirdn 0 0 0
pblukmpk 0 0 0
efqxcoih 0 0 0
fpolqwaj 0 0 0
ysnpiwil 0 0 0
qjcyq 0 0 0
eebjeiqf 0 0 0
kavxme 0 0 0
dvbpet 0 0 0
laywhqs 0 0 0
iiulbuf 0 0 0
zvozz 0 0 0
ksgvdbj 0 0 0
wqlpqfds 0 0 0
ossgz 0 0 0
atankys 0 0 0
vujlk 0 0 0
uqwfsdcf 0 0 0
zioloja 0 0 0
escus 0 0 0
oqupubib 0 0 0
frjrlz 0 0 0
ztknz 0 0 0
bfrcr 0 0 0
wkknsgsx 0 0 0
bslrb 0 0 0
fqidco 0 0 0
gqlkv 0 0 0
tmkiceu 0 0 0
cahsmyks 0 0 0
ubanju 0 0 0
qvhpfjhd 0 0 0
uadrusds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ep 0 0 0
qcjbbzf 0 0 0
kdzydbe 0 0 0
owkve 0 0 0
mwhaabt 0 0 0
bcmpzvw 0 0 0
imafxri 0 0 0
ytehy 0 0 0
hvhzq 0 0 0
ysuaiz 0 0 0
frrpqoz 0 0 0
pcvlph 0 0 0
kduet 0 0 0
ggwnu 0 0 0
nfyjlmpu 0 0 0
afunhnum 0 0 0
hdcizsc 0 0 0
jxjredzv 0 0 0
gxjbh 0 0 0
qhpotiei 0 0 0
cncrdluv 0 0 0
xpglem 0 0 0
azhkbtsm 0 0 0
azekgsr 0 0 0
btcylr 0 0 0
ettzoem 0 0 0
kmcgitd 0 0 0
otmqpwnh 0 0 0
iwhoewcd 0 0 0
toakruhq 0 0 0
lptpotlz 0 0 0
ttffon 0 0 0
gfvsci 0 0 0
rfdwpo 0 0 0
mgagius 0 0 0
jmksqhm 0 0 0
hctww 0 0 0
xtbpo 0 0 0
kyqsrht 0 0 0
cdgbktq 0 0 0
nyiuehkn 0 0 0
mxpus 0 0 0
weyvuk 0 0 0
tqsoytw 0 0 0
bvbsxibv 0 0 0
haisuj 0 0 0
jlqjt 0 0 0
hldepwu 0 0 0
omymut 0 0 0
nqiebk 0 0 0
kujlrsl 0 0 0
mxvmrf 0 0 0
rreytfry 0 0 0
jcqqjlv 0 0 0
udjxn 0 0 0
qgbpmclb 0 0 0
zfjid 0 0 0
bojgulcs 0 0 0
ionvwy 0 0 0
ywfqxpts 0 0 0
dsgsdngu 0 0 0
rmlbts 0 0 0
xsukttog 0 0 0
dnxfr 0 0 0
qgskykst 0 0 0
tsztfxvq 0 0 0
uhjzx 0 0 0
hdscx 0 0 0
uzkpa 0 0 0
griusat 0 0 0
kthhjih 0 0 0
gpudzet 0 0 0
dbhtpcp 0 0 0
ggadmw 0 0 0
xxxvrp 0 0 0
ulpnmz 0 0 0
bddjvf 0 0 0
yglphxp 0 0 0
huchcmhm 0 0 0
etalgccz 0 0 0
jlcplv 0 0 0
dymorw 0 0 0
ahitjq 0 0 0
wpuq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ivgy 0 0 0
igvxirm 0 0 0
pntxanso 0 0 0
jctiu 0 0 0
rdfshj 0 0 0
jlvamfq 0 0 0
xzufs 0 0 0
mjcqq 0 0 0
xmofpwy 0 0 0
kquafyg 0 0 0
tarqgch 0 0 0
ftlniuhu 0 0 0
tsttl 0 0 0
isjef 0 0 0
dolqnrbe 0 0 0
jcktzimj 0 0 0
rszxm 0 0 0
cwanuw 0 0 0
wqiuxadf 0 0 0
ncevnm 0 0 0
jezofh 0 0 0
uxmnqti 0 0 0
haquodd 0 0 0
mismpi 0 0 0
xgjgc 0 0 0
mkeahqo 0 0 0
smgkip 0 0 0
dgunidw 0 0 0
toezyrs 0 0 0
fvzkrdz 0 0 0
yuabg 0 0 0
qdbis 0 0 0
wjuua 0 0 0
rikmvu 0 0 0
kmplfgws 0 0 0
kqpwc 0 0 0
aecvc 0 0 0
vlmshpdz 0 0 0
zcggrxde 0 0 0
xsxntob 0 0 0
mlitrcc 0 0 0
bkdtl 0 0 0
pmhkzmt 0 0 0
spbmphh 0 0 0
pqdavx 0 0 0
cdffywi 0 0 0
peufg 0 0 0
lphee 0 0 0
xaahydix 0 0 0
ehjqqgzo 0 0 0
wmsltdru 0 0 0
mqvpmul 0 0 0
aqsim 0 0 0
huleqohu 0 0 0
eqshlcwh 0 0 0
kfwevk 0 0 0
grqfqb 0 0 0
yjnyg 0 0 0
zsgqpelm 0 0 0
hqrdzi 0 0 0
buzfhlt 0 0 0
rftel 0 0 0
coluh 0 0 0
tiuubbaj 0 0 0
bodhroa 0 0 0
xluylg 0 0 0
rximcykk 0 0 0
yogemzz 0 0 0
fbafu 0 0 0
efgwamer 0 0 0
vzxlnzax 0 0 0
qgrqdt 0 0 0
vxira 0 0 0
gxdfnut 0 0 0
mcbld 0 0 0
mfalk 0 0 0
jewuii 0 0 0
wznkok 0 0 0
jtxwc 0 0 0
diolf 0 0 0
zzpgr 0 0 0
ypqrrq 0 0 0
wdgaxvb 0 0 0
ilfhfcst 0 0 0
capigqri 0 0 0
nosxwb 0 0 0
empqcvx 0 0 0
brges 0 0 0
zvnta 0 0 0
vjsts 0 0 0
qazukn 0 0 0
otkhu 0 0 0
ycihe 0 0 0
uxvnq 0 0 0
trwhi 0 0 0
isnwhac 0 0 0
pwwxgklt 0 0 0
erlyqcnp 0 0 0
tuewux 0 0 0
ghyuh 0 0 0
bpbwlu 0 0 0
xpysal 0 0 0
pomvky 0 0 0
amhnmrq 0 0 0
ovrfrv 0 0 0
spbuu 0 0 0
qglgqii 0 0 0
isgbs 0 0 0
dcftiwsi 0 0 0
feumwbox 0 0 0
pyqipbk 0 0 0
dbdawnda 0 0 0
jdkde 0 0 0
aqrrezos 0 0 0
oocsccpe 0 0 0
iwlws 0 0 0
kwvio 0 0 0
xlepuaef 0 0 0
bhsocsja 0 0 0
srimpai 0 0 0
sydobmke 0 0 0
gikdtyi 0 0 0
budgkorw 0 0 0
lfkvzvib 0 0 0
fbduyul 0 0 0
colenqhv 0 0 0
nafbf 0 0 0
fglue 0 0 0
queudmvq 0 0 0
dmixaexb 0 0 0
eavusoo 0 0 0
vmjlrw 0 0 0

by _Harry_Potter_QAQ @ 2023-07-15 09:01:52

@编码落寞

输出

pzztktv 0 0 0


by 编码落寞 @ 2023-07-17 08:24:05

@_Harry_Potter_QAQ

这都有数据,还不知道那有问题。

这所有数据值都跟初始值一样,所以你的ans并没有被赋任何值,为初值。 你把第一组数据赋给ans之后,再比较不就可以了吗


by Light_LE @ 2023-08-07 20:58:15

你定义结构体时,设置个初始值,所有成绩都设置为-1(尽管有点离谱)才过

#include<bits/stdc++.h>
using namespace std;
struct st{
    string name;
    int ch=-1,ma=-1,en=-1;
}a,ans;
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a.name>>a.ch>>a.ma>>a.en;
        if(a.ch+a.ma+a.en>ans.ch+ans.ma+ans.en){
            ans=a;
        }
    }
    cout<<ans.name<<" "<<ans.ch<<" "<<ans.ma<<" "<<ans.en;
    return 0;
}

| 下一页