Skip to content

Instantly share code, notes, and snippets.

@mattiaferigutti
Created May 3, 2017 14:24
Show Gist options
  • Save mattiaferigutti/5856f5ffa21668b73938f649c3df322c to your computer and use it in GitHub Desktop.
Save mattiaferigutti/5856f5ffa21668b73938f649c3df322c to your computer and use it in GitHub Desktop.
checco
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