Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package day2_summa;
- import java.util.Scanner;
- /**
- *
- * @author sao_7
- */
- public class Day2_summa {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- //Cilveks ievada 3 skaitlus
- //mes sos skaitlus saskaitam
- int sum = 0;
- //jauztaisa kur glabat summu
- for(int i = 0; i < 3; i++){
- System.out.println("Ievadiet skaitli!");
- int number = sc.nextInt();
- sum = sum + number;
- }
- System.out.println("Summa ir " + sum);
- //Cikla mes laujam cilvekam ievadit skaitli
- //pieskaitam summai
- //arpus cikla summa jaizvada
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement