Finished first group of assignments

This commit is contained in:
2025-05-01 12:08:23 +09:00
parent 6a2eaa43d8
commit 0805e15bb9
27 changed files with 227 additions and 92 deletions

8
programs/lst22/info.json Normal file
View File

@@ -0,0 +1,8 @@
{
"name": "List 2ー2 +$\\\\alpha$",
"description": "2桁以上の正の整数の十の位の数字を表示するプログラム。",
"output": {
"type": "screenshot",
"content": "./assets/lst22.png"
}
}

BIN
programs/lst22/main Executable file

Binary file not shown.

18
programs/lst22/main.c Normal file
View File

@@ -0,0 +1,18 @@
#include <stdio.h>
int main(void) {
int n;
printf("Integer n: ");
scanf("%d", &n);
// Don't trust user input
if (n < 10) {
printf("Integer n must be more than 2 digits.");
return 1;
}
printf("Tens digit of interger n is %d.", n / 10 % 10);
return 0;
}