使用循环求方程的解
发布日期:2021-10-16 10:03:58
浏览次数:8
分类:技术文章
本文共 331 字,大约阅读时间需要 1 分钟。
#include "stdafx.h"
#include "stdio.h" #include "math.h" #include "conio.h"//已知x+2y+z=16,求x,y,z的正偶数。
int main() { int x=0; int y=0; int z=0; for (x = 0; x <= 16; x++) {if(x%2==0) for (y = 0; y <= 8; y++) { if(y%2==0) { z = 16 - x - 2 * y; if (z>=0 && z % 2 == 0) printf("x=%d\ny=%d\nz=%d\n\n", x, y, z); } } } getch(); return 0; }转载地址:https://blog.csdn.net/sman19999/article/details/106712802 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
初次前来,多多关照!
[***.217.46.12]2024年04月06日 11时12分19秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
【Leetcode刷题篇】leetcode938 二叉搜索树的范围和
2019-04-26
【Leetcode刷题篇】leetcode235 二叉搜索树的最近公共祖先
2019-04-26
【Leetcode刷题篇】leetcode236 二叉树的最近公共祖先
2019-04-26
【Leetcode刷题篇】leetcode230 二叉搜索树中第K小的元素
2019-04-26
【Leetcode刷题篇】leetcode173 二叉搜索树迭代器
2019-04-26
【Leetcode刷题篇】leetcode99 恢复二叉搜索树
2019-04-26
【Leetcode刷题篇】leetcode451根据字符出现频率排序
2019-04-26
【Leetcode刷题篇】leetcode703 数据流中的第k大元素
2019-04-26
【Leetcode刷题篇】leetcode378 有序矩阵中第K小的元素
2019-04-26
【Leetcode刷题篇】前K个高频元素
2019-04-26
【Leetcode刷题篇】leetcode373 查找和最小的K对数字
2019-04-26
【Leetcode刷题篇】leetcode367 有效的完全平方数
2019-04-26
【Leetcode刷题篇】剑指offer-数值的整数次方
2021-06-29
【Leetcode刷题篇】面试题01.06 字符串压缩
2021-06-29
【Leetcode刷题篇】leetcode443 压缩字符串
2021-06-29
【面试篇】数据结构-线性表
2021-06-29
【面试篇】数据结构-树形结构
2021-06-29
【面试篇】数据结构-哈希表
2021-06-29
【Leetcode刷题篇】leetcode88 合并两个有序数组
2021-06-29
【Leetcode刷题篇】剑指offer51 数组中的逆序对
2021-06-29