#33435: c++解


yp11052079@yphs.tp.edu.tw (909-08崔智媛)

學校 : 臺北市私立延平高級中學
編號 : 206288
來源 : [203.72.178.2]
最後登入時間 :
2024-04-29 16:23:00
d074. 電腦教室 -- 板橋高中教學題 | From: [203.72.178.1] | 發表日期 : 2023-01-06 09:08

c++
#include <stdio.h> #include <stdlib.h> int main() { int a,x=-1,i,c; scanf("%d",&a); for(i=0;i<a;i++) { scanf("%d",&c); if(c>x) { x=c; } } printf("%d",x); }
Close
CPP
 
#33459: Re: c++解


yp11052079@yphs.tp.edu.tw (909-08崔智媛)

學校 : 臺北市私立延平高級中學
編號 : 206288
來源 : [203.72.178.2]
最後登入時間 :
2024-04-29 16:23:00
d074. 電腦教室 -- 板橋高中教學題 | From: [203.72.178.1] | 發表日期 : 2023-01-07 09:44

更正

c++
#include <stdio.h> #include <stdlib.h> int main() { int a,x=-1,i,c; scanf("%d",&a); for(i=0;i<a;i++) { scanf("%d",&c); if(c>x) { x=c; } } printf("%d",x); }
 



 
ZeroJudge Forum