Digital 7-Shaped String

java code:

import java.util.*;
public class Hello
{
    public static void main(String[] args)
    {
Scanner s=new Scanner(System.in);
String st=s.nextLine();
char str[]=st.toCharArray();
int c,l=str.length;
for(int i=0;i<l;i++)
{
    c=1;
    for(int j=l-1;j>=0;j--)
    {
        if(i<=j)
        System.out.print(str[i]+" ");
        else
        {
            System.out.print(str[i-c]+" ");
            c++;
        }
    }
    System.out.println();
}
    }
}

Comments

  1. Casino site review - Lucky Club
    Live casino casino, licensed & approved by the Curacao Gaming Authority. The gaming house that hosts games from around the luckyclub.live world is a large betting  Rating: 5 · ‎Review by LuckyClub

    ReplyDelete

Post a Comment

Popular posts from this blog

Fisherman's Mantra

N Integers – Sum S – All Combinations(Weekly Test)

FLAMES Game