Skip to content

Commit 2263117

Browse files
authored
Merge pull request SedaKunda#4 from alihussam/master
Correct /Java/Introduction/FormattedOutput.java
2 parents d346b88 + 28b1aac commit 2263117

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

Java/Introduction/FormattedOutput.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,17 @@
2222
*/
2323
import java.util.Scanner;
2424

25-
public class FormattedOutput {
25+
public class Solution {
2626

2727
public static void main(String[] args) {
28-
Scanner sc=new Scanner(System.in);
28+
Scanner sc=new Scanner(System.in);
2929
System.out.println("================================");
30-
for(int i=0;i<3;i++)
31-
{
30+
for(int i=0;i<3;i++){
3231
String s1=sc.next();
3332
int x=sc.nextInt();
34-
String s2=sc.next();
35-
int y=sc.nextInt();
36-
String s3=sc.next();
37-
int z=sc.nextInt();
38-
System.out.printf("%-14s %03d", s1, x);
39-
System.out.println();
40-
System.out.printf("%-14s %03d", s2, y);
41-
System.out.println();
42-
System.out.printf("%-14s %03d", s3, z);
43-
System.out.println();
44-
System.out.println("================================");
33+
System.out.printf("%-14s %03d\n", s1, x);
4534
}
35+
System.out.println("================================");
36+
4637
}
4738
}

0 commit comments

Comments
 (0)