Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bohan;
- import java.util.Scanner;
- public class task4 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner in= new Scanner(System.in);
- int a=in.nextInt();
- int b=in.nextInt(),sum=0;
- while(a%3!=0) {
- a++;
- }
- while(a<b) {
- sum=sum+a;
- a=a+3;
- }
- System.out.println(sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement