Skip to main content

SMPWOW - Wow Solution (SMPWOW - Wow SPOJ Basic problem)

#Basic
Problem:-

Input

Given a positive integer 0 < x < 50.

Output

Print one word: Wo...ow (letter o must be repeted x times).

Example 1:-

Input:
1

Output:
Wow

Example 2

Input:
7

Output:
Wooooooow
Solution:-

Solution by using C language:-

#include<stdio.h>
int main()
{
int x,n;
scanf("%i",&n);
printf("W");
for(x=1;x<=n;x++)
{
printf("o",x);
}
printf("w");
return 0;
}



Solution by using CPP language:-

#include <iostream>
using namespace std;
int main()
{
int i,n;
cin >> n;
cout << "W";
for(i = 1; i <= n; i++)
{
cout << "o", i;
}
cout << "w";
return 0;
}

Solution by using JAVA language:-


import java.util.*;

public class Main
{
public static void main(String[] args)
{
int x,n;
Scanner num = new Scanner(System.in);
n = num.nextInt();
System.out.print("W");
for(x = 1; x <= n; x++){
System.out.print("o");
}
System.out.print("w");
}
}



Tags:-
#basic #basicspoj

#spoj #spojsolution #codechef #hackerrank #codingsolution #googledeveloper #microsoftdeveloper #tcsdeveloper #solution #clanguage #java #cpp #coding #japandeveloper #usadeveloper #indiandeveloper #usa #japan #india #deveper #programer #coder

Comments

Popular posts from this blog

Always keep Smiling OK!

Always keep Smiling OK! Tags : #ankursatyarthi #ankurindiaofficial #innerquality #fact #truth #truthoflife #life #lifefact #usa #japan #motivation #morning #guitarist #pianist #happy #prosparity #reality #blog #teen #peace #calm #india #lucknow #mrpassionate #mrpassionate123 #soul #love #king #attitude #personality

Thinking too much

Thinking too much Tags : #ankursatyarthi #ankurindiaofficial #innerquality #fact #truth #truthoflife #life #lifefact #usa #japan #motivation #morning #guitarist #pianist #happy #prosparity #reality #blog #teen #peace #calm #india #lucknow #mrpassionate #mrpassionate123 #soul #love #king #attitude #personality