Skip to main content

Posts

Showing posts from October, 2018

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);