From 87ba48dce5d3d1573bc6f8173b9e2a43621a3a79 Mon Sep 17 00:00:00 2001 From: smallkun Date: Mon, 17 Feb 2025 19:57:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'2207/C=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E7=B2=BE=E9=80=9A120=E9=A2=98.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2207/C语言精通120题.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/2207/C语言精通120题.md b/2207/C语言精通120题.md index 86da3f0..3371976 100644 --- a/2207/C语言精通120题.md +++ b/2207/C语言精通120题.md @@ -75,7 +75,17 @@ int main(){ 5.编写程序:输入9时23分并把它化为分钟后输出。(从零点整开始计算)。 +```C +#include +int main(){ + int h, m; + scanf("%d时%d分", &h, &m); + printf("%d分钟\n", h*60+m); + + return 0; +} +``` 6.要将“Chiina”翻译成密码,密码规律是:用原来的字母后面第4个字母代替原来的字母。例如,字母“ A”后面的4个字母是“E”,用“E”代替“A”。因此,“Chian”应译成“Glmre”。用赋初值的方法 是c1,c2,c3,c4,c5五个变量的值分别为‘C’、‘h’、‘i’、‘n’、‘a’,经过运算,使c1、c2、 c3、c4、c5分别为‘G’、‘l’、‘m’、‘r’、‘e’,并输出