LoginSignup
0
0

More than 3 years have passed since last update.

忘備録_Logic_1~10までの和

Posted at
Sample.java


public class Sample {

    public static void main(String[] args) {
        int x = 1; int y = 10;
        int sum = 0;
        for(int i=x; i<=y; i++) {
            sum +=i;
        }
        System.out.println(sum);
    }
実行
55

}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0