import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkgfor.exercicio.pkg1;
/**
*
* @author binho
*/
public class ForExercicio1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
System.out.println("Quantos patos foram passear?");
for(int n=entrada.nextInt(); n>=1;n--){
System.out.printf("%d patinhos foram passear\n" +
"Além das montanhas\n" +
"Para brincar\n" +
"A mamãe gritou: Quá, quá, quá, quá\n" +
"Mas só %d patinhos voltaram de lá.\n",n,n-1);}
{System.out.printf("\nA mamãe patinha foi procurar\n" +
"Além das montanhas\n" +
"Na beira do mar\n" +
"A mamãe gritou: Quá, quá, quá, quá\n" +
"E os"+ n + "patinhos voltaram de lá. ");
} }
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkgfor.exercicio.pkg1;
/**
*
* @author binho
*/
public class ForExercicio1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
System.out.println("Quantos patos foram passear?");
for(int n=entrada.nextInt(); n>=1;n--){
System.out.printf("%d patinhos foram passear\n" +
"Além das montanhas\n" +
"Para brincar\n" +
"A mamãe gritou: Quá, quá, quá, quá\n" +
"Mas só %d patinhos voltaram de lá.\n",n,n-1);}
{System.out.printf("\nA mamãe patinha foi procurar\n" +
"Além das montanhas\n" +
"Na beira do mar\n" +
"A mamãe gritou: Quá, quá, quá, quá\n" +
"E os"+ n + "patinhos voltaram de lá. ");
} }
}