最短代码

dinosaurgy 2019-05-31 22:12:06 2019-05-31 22:19:05 24

最短代码,不服者来战

2行

#include<iostream>
int main(){	int n,a[105],sum=0;std::cin>>n;for(int i=1;i<=n;i++){std::cin>>a[i];sum+=a[i];}std::cout<<sum;}
{{ vote && vote.total.up }}

共 17 条回复

wangyuzhe 蒟蒻

又双叒叕更新!!! 122B!!!

#include<stdio.h>
int main(){int n,a[99],s=0,i=0;scanf("%d",&n);for(;i<n;i++){scanf("%d",&a[i]);s+=a[i];}printf("%d",s);}
wangyuzhe 蒟蒻

再次更新!!! 最短代码123B!!!

#include<stdio.h>
int main(){int n,a[101],s=0,i=0;scanf("%d",&n);for(;i<n;i++){scanf("%d",&a[i]);s+=a[i];}printf("%d",s);}
wangyuzhe 蒟蒻

最短C++/C代码在此!仅124B

#include<stdio.h>
int main(){int n,a[101],s=0,i=0;scanf("%d",&n);for(;i<n;i++){scanf("%d",&a[i]);s=s+a[i];}printf("%d",s);}
yjh

666

tctm99

厉害呀?

tctm99
Adeline

呵呵 我就呵呵一笑