首页 > 其他分享 >5.24

5.24

时间:2023-05-24 18:56:41浏览次数:32  
标签:elseprintf b% ld decomposed 5.24 printf

#include<stdio.h>
void main(){
long int a,b,c;
printf("Please enter a optional fraction(a/b):");
scanf("%ld%ld",&a,&b);
printf("It can be decomposed to:");
while(1){
if(b%a)
c=b/a+1;
else{
c=b/a;
a=1;
}
if(a==1)
{
printf("1/%ld\n",c);
break;}
else
printf("1/%ld + ",c);
a=a*c-b;
b=b*c;
if(a==3&&b%2==0)
{
printf("1/%ld + 1/%ld\n",b/2,b);
}}
}

标签:elseprintf,b%,ld,decomposed,5.24,printf
From: https://www.cnblogs.com/szm123/p/17429238.html

相关文章

  • 5.24打卡
     3.程序流程图 4.代码实现#include<bits/stdc++.h>usingnamespacestd;main(){intx,y,z,num=0;printf("MenWomenChildren\n");for(x=0;x<=10;x++){y=20-2*x;z=30-x-y;if(3*x+2*y+z==50)......
  • 2023.5.24-人件-5月份读后感2
    最近,我阅读了人件的下一部分,有了一些感想。过去,我对于办公环境的重视程度不够。假设除了现在的职责之外,还让你负责为手下提供办公环境和公益设施。你必须为每个人确定工作环境的种类、分配的开支总数等等,而你如何着手做这些事呢?在以后,可以更加重视办公的环境。过去,我认为加班是......
  • 最完美WIN10_Pro_22H2.19045.2486软件选装纯净版VIP38.5
    【系统简介】=============================================================1.本次更新母盘来WIN10_Pro_22H2.19045.2486。进一步优化调整。2.不支持更新,更新后精简版更新......
  • 解决fatal: unable to connect to github.com: github.com[0: 20.205.243.166]: err
    输入下面命令行pipinstall"git+git://github.com/erikwijmans/Pointnet2_PyTorch.git#egg=pointnet2_ops&subdirectory=pointnet2_ops_lib"出现错误  解决方法......
  • Electron RequestError: connect ETIMEDOUT 20.205.243.166:443
    问题描述下载electron时,卡在了下载超时,换github.comip无效、用梯子无效,直到官网这里找到了原因:MirrorYoucanuseenvironmentvariablestooverridethebaseURL,......
  • OpenJudge 1.5.24 正常血压
    24:正常血压总时间限制:1000ms内存限制:65536kB描述监护室每小时测量一次病人的血压,若收缩压在90-140之间并且舒张压在60-90之间(包含端点值)则称之为正常,现给出某......