Advertisement
sergAccount

Untitled

Sep 27th, 2020
1,022
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package myapp7;
  7.  
  8. public class MyApp7 {
  9.  
  10.     /*
  11.     Задача1
  12.     Написать код который выводит целые числа от 10 до 1
  13.     (т. е. вывод чисел в обратном порядке)
  14.     (решить задачу с помощью цикла for)
  15.     */    
  16.     public static void main(String[] args) {
  17.         // TODO code application logic here
  18.         // используем оператор -- (i = i -1)
  19.         for(int i = 10; i>0; i--){
  20.             System.out.println(i);
  21.         }        
  22.     }    
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement