Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package DataTypes;
- import java.util.Scanner;
- public class TownInfo_04 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String townName = scanner.nextLine(); //име на града
- //integer types -> byte, short, int, long, BigInteger -> %d
- //double types -> double, float -> %f
- int population = Integer.parseInt(scanner.nextLine()); //населние на града
- short area = Short.parseShort(scanner.nextLine()); //площ на града
- System.out.printf("Town %s has population of %d and area %d square km.", townName, population, area);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement