## Algorithm

Problem Name: beecrowd | 1157

# Divisors I

Adapted by Neilor Tonin, URI Brazil

Timelimit: 1

Read an integer N and compute all its divisors.

## Input

The input file contains an integer value.

## Output

Write all positive divisors of N, one value per line.

 Input Sample Output Sample 6 1 2 3 6

## Code Examples

### #1 Code Example with C++ Programming

```Code - C++ Programming```

``````
#include <bits/stdc++.h>

using namespace std;

int main(){
int n;
cin >> n;
for (int i = 1; i  < = n; i++){
if (n % i == 0){
cout << i << endl;
}
}
return 0;
}
``````
Copy The Code &

Input

cmd
6

Output

cmd
1 2 3 6

### #2 Code Example with Java Programming

```Code - Java Programming```

``````
import java.io.IOException;
import java.util.Scanner;

public class Main{
public static void main(String[] args) throws IOException{
Scanner input = new Scanner(System.in);
int n = input.nextInt();
for (int i = 1; i  < = n; i++){
if (n % i == 0){
System.out.println(i);
}
}
}
}
``````
Copy The Code &

Input

cmd
6

Output

cmd
1 2 3 6

### #3 Code Example with Javascript Programming

```Code - Javascript Programming```

``````
var lines = input.split('\n');

var n = parseInt(lines.shift());

for (var i = 1; i  < = n; i++){
if (n % i === 0){
console.log(i);
}
}
``````
Copy The Code &

Input

cmd
6

Output

cmd
1 2 3 6

### #4 Code Example with Python Programming

```Code - Python Programming```

``````
n = int(input())

for i in range(1, n+1):
if (n % i == 0):
print(i)
``````
Copy The Code &

Input

cmd
6

Output

cmd
1 2 3 6