#-*- coding:UTF-8 -*- #环境:python3 print("Enter the numbers between 1 and 100:") enterList=[] #记录输入的元素 while 1: a = int(input(">>>")) #将输入转换为int型 if a == 0: print ("Your input:",enterList) break #结束输入 if a<1 or a&g
package study01; import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //正数的个数 int count1 = 0; //负数的个数 int count2 = 0; int input = sc.nextInt(); while (input != 0) { if (input > 0)
include "stdafx.h" #include<iostream> #include<vector> #include<algorithm> #include<iomanip> using namespace std; class Visit { public: int countPath(vector<vector<int> > map, int n, int m) { int count=0; int
1.打印0-10(while/for) count = 0 while count < 11: print(count) count += 1 for i in range(11): print(i) 2.求1-100所有数的和 a = 1 sum = 0 while a < 101: sum += a # print(sum) a += 1 print(sum) 3.打印1-100之间的偶数 for n in range(1,101): if n % 2 == 0: print(n) 4.打