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