【NB】忽略倍数

编程开发   © 文章版权由 admin 解释,禁止匿名转载

#楼主# 2023-2-24

忽略倍数!
package One;

import java.util.Scanner;

public class Session5 {
public void eN() {
for(int i=1;i<=100;i++) {
if(i%3==0 || i%5==0)
continue;

System.out.println(i);
}
}
public void dN() {
for(int i =1;i<=10;i++) {
if(i%2==0) {
continue;
}
System.out.println(i);
}
}
public void cN() {
Scanner sc = new Scanner(System.in);
int a =sc.nextInt();
int money=1;
int sum=0;
for(int i=1;i<=a;i++) {
sum+=money;//先算一下第一天的钱
money*=2;
}
System.out.println(sum);
}
public void bN() {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int c= 1;
long b =a;
while(c b*=(a-c);
c++;
}
System.out.println(b);
}
public void aN() {
while(true) {
Scanner sc = new Scanner(System.in);
try {
long sum=1;
int a = sc.nextInt();
while(a>0) {
sum*=a;
a--;
}
System.out.println(sum);

} catch (Exception e) {
// TODO: handle exception
}
}
}
public static void main(String[] args) {
Session5 v1 = new Session5();
v1.eN();;
}
}

沙发
NB狐狸 2023-2-27
画画的人可以正面看着这个世界,好的地方和不好的地方,都能比其他人更直接感受到。
板凳
NB狐狸 2023-3-8
我感谢一切我有权奉承的神明,让我在这个不唯一的世界遇见唯一的你。
地板
NB狐狸 2023-3-8
是什么性别都没关系了。
不想被性别定义。

评论

登录后才可发表内容
  • 主题

    140

  • 帖子

    219

  • 关注者

    0

TA的新帖
Copyright © 2019 凯特网.   Powered by HYBBS 2.3.4  

Runtime:0.1001s Mem:2076Kb