クエスチョン8,9完了しました。

This commit is contained in:
s-ohasi
2026-09-11 14:42:48 +09:00
parent 2ce170f405
commit 1efcc4228c
2 changed files with 26 additions and 5 deletions

View File

@@ -6,9 +6,9 @@
*/
public class PTra01_08 {
public static void main(String[] args) {
float fl = 3.14f;
// TODO float型の変数 fl を 3.14 で初期化してください。
System.out.println(fl);
// TODO fl の値を出力してください
}

View File

@@ -6,11 +6,32 @@
*/
public class PTra01_09 {
public static void main(String[] args) {
byte smal ;
short mediam;
int count;
long big;
float lot;
double price;
char S;
boolean a;
// TODO 基本型8種類の変数を宣言します(変数名は自分できめてOKです)
smal = 127;
mediam = 32000;
count =2000000;
big =9000000000L;
lot = 3;
price =1980.5;
S='咲';
a = true;
// TODO 宣言した変数に、値を代入してください(代入する値はなんでもOKです)
System.out.println(smal);
System.out.println(mediam);
System.out.println(count);
System.out.println(big);
System.out.println(lot);
System.out.println(price);
System.out.println(S);
System.out.println(a);
// TODO それぞれの変数の中身を出力してください
}