gpt4 book ai didi

C编程: Do an operation until the desired result

转载 作者:行者123 更新时间:2023-11-30 20:24:46 26 4
gpt4 key购买 nike

我对编程很陌生,所以请帮助我。这是我的算法:

Enter a number
If the number is greater than 26
Subtract 26 from the number
Until the number is less than 26
Then display the final result

我该如何编写代码?谢谢!

最佳答案

试试这个。但下次在提出你的问题时一定要花点功夫

if (scanf("%d", &n) == 1) {
while (n >= 26) {
n -= 26;
}
printf("%d", n) ;
}

关于C编程: Do an operation until the desired result,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32663957/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com