Created
May 3, 2017 14:24
-
-
Save mattiaferigutti/5856f5ffa21668b73938f649c3df322c to your computer and use it in GitHub Desktop.
checco
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
/** | |
* Created by Mattia on 03/05/2017. | |
*/ | |
public class NomeCognome | |
{ | |
public static void main(String[] args) throws IOException { | |
InputStreamReader reader = new InputStreamReader(System.in); | |
BufferedReader tastiera = new BufferedReader(reader); | |
System.out.println("Inserisci il nome:"); //nome | |
String nome; | |
nome = tastiera.readLine(); | |
System.out.println("Inserisci il cognome:"); //cognome | |
String cognome; | |
cognome = tastiera.readLine(); | |
System.out.print(cognome + " " + nome); //cognome + nome | |
System.out.println("\nIl valore del cognome è:" + cognome.length()); | |
int array[]= new int [10]; | |
int a=0; | |
for (int i=0; i<(cognome.length())*10; i+=cognome.length(), a++) { | |
System.out.println(array[a]=i); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment