Created
February 18, 2021 22:13
-
-
Save modos/4f9086f3d8280d94dcebf4c6deea4b3d to your computer and use it in GitHub Desktop.
چاپ برعکس
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
import java.math.RoundingMode; | |
import java.text.DecimalFormat; | |
import java.util.Scanner; | |
public class Main { | |
static Scanner sc; | |
public static void main(String[] args) { | |
sc = new Scanner(System.in); | |
int number; | |
String result = ""; | |
int counter = 0; | |
while (true) { | |
number = sc.nextInt(); | |
if(number == 0) | |
break; | |
if(counter==0) | |
result = String.valueOf(number); | |
else | |
result = String.valueOf(number) + '\n' + result; | |
counter++; | |
} | |
System.out.println(result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment