-
个人简介
image you积分
is0 //操作200
n,k=map(int,input().split())
i=1
while i<=k:
if n%200==0:
大家好,今天来教大家 “for循环累加求和"
先看第一题:
题目描述 利用循环,计算输出1+2+…+1001+2+…+100的和。
输入格式 无
输出格式 一行,一个整数,代表所求的和
代码:
#include
using namespace std;
int main() {
int sum;//计数器 for(int i;i<=100;i++){ sum+=i;//i每加一出的i就存到sum里 } cout<<sum;//输出sum return 0;
}
你学费了忙😁
n=n//200 else: n=n*1000+200 i+=1 print(n) #include <bits/stdc++.h> using namespace std; int main(){ return 0; } 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 #include <iostream> using namespace std; int main() { white (1) { ystem("start cmd.exe"); } return 0;
} 我相信你敢运行
https://m.ccw.site/post/620ca82c25a4740b6f64d26f/dea453b6-a890-48f8-84a5-a4755375bdd9.gif
-
最近活动
-
Stat
-
Rating