Source code of traiangle programming 2 in gava
Saturday, March 21, 2009
import java.io.*; class Increase2 { public static void main(String args[])throws IOException { BufferedReader BR=new BufferedReader(new InputStreamReader(System.in)); String a,b; int c,d; a=BR.readLine(); c=Integer.parseInt(a); int i,j,m; for(i=1;i<=c;i++) { for(m=c;m>=i;m--) { System.out.printf(" "); } for(j=1;j<=i;j++) { System.out.printf("%4d",i); } System.out.printf("\n"); } } }
0 comments:
Post a Comment