Dev C++运行后窗口马上关闭及其一系列问题~
来源:百度知道 编辑:UC知道 时间:2024/05/27 19:49:10
#include <iostream>
using namespace std;
int main()
{ int gotbaha(int);
int n;
cout<<"请输入一个不小于6的偶数."<<endl;
cin >>n;
while (n<6||n%2!=0)
{
cout<<"输入错误,请重新输入一个不小于6的偶数!"<<endl;
cin >>n;
}
int gotbaha(int n);
system("pause");
return 0;
}
int gotbaha(int n)
{
bool prime(int);
int x=3;
for (;x<n-x;x++)
{
if(prime(x)==false||prime(n-x)==false) continue;
else cout<<n<<"="<<x<<"+"<<n-x<<endl; break;
}
return 0;
}
bool prime(int x)
{
int i;
for(i=2;i<x;i++)
{
if(x%i==0) return false;
}
return true;
}
//不是停不住就是停住了没有cout<<n<<"="<<x<<"+"<<n-x<<endl; break;这一句的反应····Help me~
using namespace std;
int main()
{ int gotbaha(int);
int n;
cout<<"请输入一个不小于6的偶数."<<endl;
cin >>n;
while (n<6||n%2!=0)
{
cout<<"输入错误,请重新输入一个不小于6的偶数!"<<endl;
cin >>n;
}
int gotbaha(int n);
system("pause");
return 0;
}
int gotbaha(int n)
{
bool prime(int);
int x=3;
for (;x<n-x;x++)
{
if(prime(x)==false||prime(n-x)==false) continue;
else cout<<n<<"="<<x<<"+"<<n-x<<endl; break;
}
return 0;
}
bool prime(int x)
{
int i;
for(i=2;i<x;i++)
{
if(x%i==0) return false;
}
return true;
}
//不是停不住就是停住了没有cout<<n<<"="<<x<<"+"<<n-x<<endl; break;这一句的反应····Help me~
int gotbaha(int); 有这种调用函数的方法吗
#include <iostream>
using namespace std;
int main()
{ int gotbaha(int);
int n;
cout<<"请输入一个不小于6的偶数."<<endl;
cin >>n;
while (n<6||n%2!=0)
{
cout<<"输入错误,请重新输入一个不小于6的偶数!"<<endl;
cin >>n;
}
gotbaha(n); //改成这样
system("pause");
return 0;
}
int gotbaha(int n)
{
bool prime(int);
int x=3;
for (;x<n-x;x++)
{
if(prime(x)==false||prime(n-x)==false) continue;
else cout<<n<<"="<<x<<"+"<<n-x<<endl; break;
}
return 0;
}
bool prime(int x)
{
int i;
for(i=2;i<x/2;i++) //改成这样
{
if(x%i==0) return false;
}
return true;
}
主函数最后再加两条重复的语句用于延迟:
int main()
{
......
cin.get();
cin.get();
}
DEV C++编译的程序运行后自动关闭
我在开始菜单-运行 里面输入指令出现DOS窗口后马上就消失了?
泡泡堂关后弹出窗口
用dev-c编译运行的c程序怎样才能看到运行结果啊,每次一闪就没了。。。。。。。。。
IE窗口打开后马上关闭怎么办?
开机后马上跳出两个RUNDLL窗口
format c: /s后能马上运行机子上的2000安装文件吗?
用turbo C调试程序,运行程序后输入数据,再回车,窗口却跳回到turbo C的编辑窗口,无法看到程序运行的结
C语言上机按CTRL+F9运行后出现黑屏,但返回不到编译窗口怎么办????????
双击浏览器后出现C:\PROGRA~1\intern\explorer.exe运行窗口