Created
April 17, 2015 06:23
-
-
Save shcherbakoff/1aac01a38cc63ac5d7ab to your computer and use it in GitHub Desktop.
package com.javarush.test.level03.lesson04.task05;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level03.lesson04.task05; | |
/* Сумма 10 чисел | |
Вывести на экран сумму чисел от 1 до 10 построчно (должно быть 10 строк): | |
1 | |
1+2=3 | |
1+2+3=6 | |
1+2+3+4=10 | |
... | |
Пример вывода: | |
1 | |
3 | |
6 | |
10 | |
... | |
*/ | |
public class Solution | |
{ | |
public static void main(String[] args) | |
{ | |
int sum = 0; | |
for(int i=1; i <= 10; i++) | |
{ | |
sum = sum + i; | |
System.out.println(sum); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment