郑州轻工业大学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 while (d d=d+c;
e=e+d;
if(d==b) {
System.out.println(e+a);
}
}
}else {
System.out.println(a);
}

}

}

你可能感兴趣的:(郑州轻工业大学OJ:java1006)