編寫程式計算1到100中既能被3整除又能被7整除的

時間 2021-09-14 21:14:55

1樓:

public class $

}system.out.println("一共" + count + "個");}}

2樓:匿名使用者

private sub form_click()for i = 100 to 200

if i mod 3 = 0 and i mod 7 <> 0 then

s = s + i

end if

next

t = msgbox("結果是" & s, vbokonly, "你的答案")

end sub

3樓:憋不住事兒

這個不難,難的是

你要啥語言的啊?!!

編寫一個j**a應用程式,輸出1到100之間所有既可以被3整除,又可被7整除的數。

4樓:兔丞飛

public class c {

public static void main(string args) {

for(int i=10;i<100;i++){if(i%7==0&&i%3==0){

system.out .println(i);

擴充套件資料//需求:請將1到100之間所有能被3整除的數字新增到新陣列arr中,並列印到控制檯

var arr=//宣告一個空陣列

for(var i=1;i<=100;i++){//遍歷1-100if(i%3==0){//找出能被3整除的數字arr[arr.length] = i;//通過陣列的下標新增元素console.log ( arr )//列印到控制檯檢測

5樓:匿名使用者

樓上上的方法確實神奇,很棒,可以拿分。

gzbao是不是高則寶縮寫?

6樓:

//高效率方法

public static void main(string args)}

7樓:大贏合治

public class gongbei}}

8樓:匿名使用者

拿分了gzbao9999 是神人,這都可以

9樓:匿名使用者

public class a3 } }

10樓:

向樓上gzbao9999同學學習了~~~

好方法!!

c語言程式設計輸出1∼100間既能被3整除又能被7整除的數

11樓:旅初彤

#include

void main()}}

12樓:匿名使用者

#include

int main()

}printf("\n");

return 0;}

C語言程式,請你編寫程式計算每個學生的平均成績

問明 include void main float a 10 10 用來存放10名學生的5門成績,最後一位用於存放平均成績 int i,j float sum 0.0 for i 0 i 10 i printf 請輸入第 d個學生的5門成績 i 1 for j 0 j 5 j scanf f a ...

用c 編寫程式,計算 1 2 3n要求

include using namespace std int f int i int main int argc,char argv 函式不能巢狀定義。所以int f int i 函式需要放在主函式外面。修改後的 可以正確執行。 你把函式f放在外面試試,下面是c的 include stdio.h ...

編寫程式統計500到1000之間素數的個數

public function issushu byval pa as integer as boolean dim pb as integer pb pa 1 dim res as boolean res true for i 2 to pb if pa mod i 0 then res fals...