Negative days completion.
This commit is contained in:
10
programs/abs/info.json
Normal file
10
programs/abs/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題 2",
|
||||
"description": "整数値を読み込み、その絶対値を出力するプログラム。",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/abs.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/abs/main
Executable file
BIN
programs/abs/main
Executable file
Binary file not shown.
17
programs/abs/main.c
Normal file
17
programs/abs/main.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int x, y;
|
||||
|
||||
printf("Input integer: ");
|
||||
scanf("%d", &x);
|
||||
|
||||
y = x;
|
||||
|
||||
if (y < 0)
|
||||
y = -y;
|
||||
|
||||
printf("Absolute value of %d is %d.\n", x, y);
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
programs/lst33/info.json
Normal file
10
programs/lst33/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題 1 List 3-3",
|
||||
"description": "5の倍数判定プログラム",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/lst33.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/lst33/main
Executable file
BIN
programs/lst33/main
Executable file
Binary file not shown.
15
programs/lst33/main.c
Normal file
15
programs/lst33/main.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
printf("Input integer: ");
|
||||
scanf("%d", &n);
|
||||
|
||||
if (n % 5)
|
||||
puts("The number is not divisible by 5.");
|
||||
else
|
||||
puts("The number is divisible by 5.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
programs/lst34/info.json
Normal file
10
programs/lst34/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題 1 List 3-4",
|
||||
"description": "偶数奇数判定プログラム",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/lst34.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/lst34/main
Executable file
BIN
programs/lst34/main
Executable file
Binary file not shown.
15
programs/lst34/main.c
Normal file
15
programs/lst34/main.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
printf("Input integer: ");
|
||||
scanf("%d", &n);
|
||||
|
||||
if (n % 2)
|
||||
puts("The integer is odd.");
|
||||
else
|
||||
puts("The integer is even.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
programs/lst35/info.json
Normal file
10
programs/lst35/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題 1 List 3-5",
|
||||
"description": "非ヌル判定プログラム",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/lst35.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/lst35/main
Executable file
BIN
programs/lst35/main
Executable file
Binary file not shown.
15
programs/lst35/main.c
Normal file
15
programs/lst35/main.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
printf("Input integer: ");
|
||||
scanf("%d", &n);
|
||||
|
||||
if (n)
|
||||
puts("The integer is not null(zero).");
|
||||
else
|
||||
puts("The integer is null(zero).");
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
programs/lst36/info.json
Normal file
10
programs/lst36/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題 1 List 3-6",
|
||||
"description": "2つの整数値の等価検証プログラム",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/lst36.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/lst36/main
Executable file
BIN
programs/lst36/main
Executable file
Binary file not shown.
18
programs/lst36/main.c
Normal file
18
programs/lst36/main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n1, n2;
|
||||
|
||||
printf("Integer 1: ");
|
||||
scanf("%d", &n1);
|
||||
|
||||
printf("Integer 2: ");
|
||||
scanf("%d", &n2);
|
||||
|
||||
if (n1 == n2)
|
||||
puts("Both values are equivalent to each other.");
|
||||
else
|
||||
puts("Both values are not equivalent to each other.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
programs/lst37/info.json
Normal file
10
programs/lst37/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題 1 List 3-7",
|
||||
"description": "2つの整数値の等価検証プログラム\\n\\n\\\\ref{lst36}の条件の否定に変更したプログラム",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/lst37.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/lst37/main
Executable file
BIN
programs/lst37/main
Executable file
Binary file not shown.
18
programs/lst37/main.c
Normal file
18
programs/lst37/main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n1, n2;
|
||||
|
||||
printf("Integer 1: ");
|
||||
scanf("%d", &n1);
|
||||
|
||||
printf("Integer 2: ");
|
||||
scanf("%d", &n2);
|
||||
|
||||
if (n1 != n2)
|
||||
puts("Both values are not equivalent to each other.");
|
||||
else
|
||||
puts("Both values are equivalent to each other.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
programs/lst38/info.json
Normal file
10
programs/lst38/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題 1 List 3-8",
|
||||
"description": "整数値の最下位桁判定プログラム",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/lst38.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/lst38/main
Executable file
BIN
programs/lst38/main
Executable file
Binary file not shown.
15
programs/lst38/main.c
Normal file
15
programs/lst38/main.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
printf("Input integer: ");
|
||||
scanf("%d", &n);
|
||||
|
||||
if (n % 10 == 5)
|
||||
puts("Ones digit of the integer is 5.");
|
||||
else
|
||||
puts("Ones digit of the integer is not 5.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user