C 练习实例81
C 语言教程
· 2019-02-22 14:12:49
题目:809*??=800*??+9*?? 其中??代表的两位数, 809*??为四位数,8*??的结果为两位数,9*??的结果为3位数。求??代表的两位数,及809*??后的结果。
程序分析:无。
实例
// Created by www.codercto.com on 15/11/9.
// Copyright © 2015年 码农教程. All rights reserved.
#include <stdio.h>
void output(long int b, long int i){
printf("\n%ld = 800 * %ld + 9 * %ld\n", b,i,i);
}
int main(){
void output(long int b, long int i);
long int a,b,i;
a = 809;
for(i = 10; i < 100; i++){
b = i * a;
if (b >= 1000 && b <= 10000 && 8 * i < 100 && 9 * i >= 100){
output(b, i);
}
}
return 0;
}
以上实例运行输出结果为:
9708 = 800 * 12 + 9 * 12
点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html
Algorithms Unlocked
Thomas H. Cormen / The MIT Press / 2013-3-1 / USD 25.00
Have you ever wondered how your GPS can find the fastest way to your destination, selecting one route from seemingly countless possibilities in mere seconds? How your credit card account number is pro......一起来看看 《Algorithms Unlocked》 这本书的介绍吧!