各位大神,帮我看看我的程序到底有什么问题? - 爱问答

(爱问答)

各位大神,帮我看看我的程序到底有什么问题?

#include.<stdio.h>
int main()
{
 int i,x,c,n;
 scanf("%d",&x,&c);
 if(x<c)  n=c;
  else n=x;
 for(i=n;i>=0;i--)
 {
 if(x%n==0&&c%n==0)  break;
 }
 printf("%d",n);
 return 0;
}

你这个程序写的有些繁琐,vector用的有些多余

可以参考下面这个

#include <iostream>

#include <iomanip>

#include <fstream>

#include <string>

#include <map>

using namespace std;

int main()

{

string word,filename;

map<string,int> smap;

cout<<"请输入要打开的文件名"<<endl;

cin>>filename;

复制到编译器里运行一下,看看哪里报错

相关标签:大神

下一篇:web前端培训去哪儿?

上一篇:大神帮我看看这段程序有什么错误,谢谢了!

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?