• 2022-06-07
    使用while 语句实现打印出1至10.count = 1while ( ) print (count) count = count + 1 if i>10 : break
    A: 1 :
    B: True :
    C: True
    D: 0
  • A,B

    内容

    • 0

      The output of the following code is ____.<br/>count = 1; /* initialize count */ while (count &lt;= 10) { printf("%d ",count); count++; /* increment count */ } A: 1 1 1 1 1 1 1 1 … B: 1 2 3 4 5 6 7 8 9 C: 1 2 3 4 5 6 7 8 9 10 D: 1 2 3 4 5 6 7 8 9 10 11

    • 1

      for(count = 1;sum=0; count <=10; count++)是正确的for语句

    • 2

      下列程序的输出结果是() num = 27 count = 0 while num > 0: if num % 2 == 0: num /=2 elif num % 3 ==0: num /= 3 else: num -=1 count += 1 print (count)

    • 3

      使用for 语句把 Python 字符串的每个字母依次打印出来,下面哪个选项实现了() A: count=1 for letter in Python: print(“Python的第"+str(count)+"个字母是”+letter) count=count+1 B: count=1 for letter "Python”: print(“Python的第"+str(count)+"个字母是”+letter) count=count+1 C: count=1 for letter in "Python": print(“Python的第"+str(count)+"个字母是”+letter) count=count+1

    • 4

      下面程序的运行结果是()。#includeintmain(){inta,s,n,count;a=2;s=0;n=1;count=1;while(count<=7){n=n*a;s=s+n;++count;}printf(“%d”,s);return0;}