题解 | #小乐乐求和#
小乐乐求和
https://www.nowcoder.com/practice/ce0b2eacd3d04647831358c2876e44ff
#include<stdio.h> int main() { long long int n,sum=0; scanf("%lld",&n); for(int i=1;i<=n;i++){ sum+=i; } printf("%lld",sum); return 0; }
小乐乐求和
https://www.nowcoder.com/practice/ce0b2eacd3d04647831358c2876e44ff
#include<stdio.h> int main() { long long int n,sum=0; scanf("%lld",&n); for(int i=1;i<=n;i++){ sum+=i; } printf("%lld",sum); return 0; }
相关推荐