郑州轻工业大学OJ:java1006
作者:互联网
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int a;
int b;
int c;
int d;
int e=0;
Scanner in = new Scanner(System.in);
a=in.nextInt();
b=in.nextInt();
c=in.nextInt();
d=a;
if(d<b) {
while (d<b) {
d=d+c;
e=e+d;
if(d==b) {
System.out.println(e+a);
}
}
}else {
System.out.println(a);
}
}
}
标签:轻工业,int,System,Scanner,nextInt,java1006,out,public,OJ 来源: https://blog.csdn.net/weixin_45065220/article/details/91126100