Algorithm Analysis
We print a strip of '#'
characters using a for loop.
Algorithm Implementation
Read the input value .
scanf("%d", &n);
Print '#'
characters.
for (i = 0; i < n; i++) printf("#"); printf("\n");
Java Implementation
import java.util.*; public class Main { public static void main(String[] args) { Scanner con = new Scanner(System.in); int n = con.nextInt(); for(int i = 0; i < n; i++) System.out.print('#'); con.close(); } }
Python Implementation
Read the input value .
n = int(input())
Print '#'
characters.
for i in range(n): print('#', end='')