酷代码 AI
菜单
全部AI  /  热门  /  AI写代码神器
服务商

小 a 想进城逛逛,但是守城人要求必须报上自己的身高体重。 但是当时的秤是十六两一斤,小a只知道自己用十两一斤的秤称重时的斤两。 请你帮他算算应该如何上报数据。 输入格式: 输入十两一斤的重量数,输入有两行。 第一行是斤数。 第二行是两数。 输出格式: 输出对应十六两一斤秤的重量数,输出有两行。 第一行是斤数。 第二行是两数。用c语言

```c #include <stdio.h> int main() { int ten_jin, ten_liang; scanf("%d", &ten_jin); scanf("%d", &ten_liang); int total_ten = ten_jin * 10 + ten_liang; int sixteen_jin = total_ten * 16 / 10; int sixteen_liang = total_ten * 16 % 10; printf("%d\n", sixteen_jin); printf("%d\n", sixteen_liang); return 0; } ``` [2024-10-31 21:43:52 | AI写代码神器 | 135点数解答]

相关提问