Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Sobuj;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int n = input.nextInt();
- for(int i=1; i<=n; i++) {
- if(i < n) {
- if(i%2 == 0) {
- System.out.print("0, ");
- } else {
- System.out.print("1, ");
- }
- } else if(i == n) {
- if(i%2 == 0) {
- System.out.print("0");
- } else {
- System.out.print("1");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement