A.cpp产生数据,并在A.cpp中调用B程序,将A.cpp的数据当作B的输入参数

weibo_boer weibo_boer 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
B.cpp
#include<iostream>
using namespace std;
int main()
{
int m,n;
cin>>m>>n;
cout<<m*n<<endl;
return 0;
}

A.cpp
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<string>
using namespace std;
int main()
{
for(int i=0;i<100;i++)
{
string s="b.exe ";
char temp[2];
itoa(i,temp,10);
s+=temp;
if(i%2==0)
s+=" 0";
else
s+=" 1";
char A[20];
cout<<s<<endl;
for(int j=0;j<s.length();j++)
A[i]=s[i];
system(A);
}

}

他们都在同一个文件夹下,这样可以做到吗?
直接这样写出不来结果。


...全文
评论 7
收藏 已收藏
分享
返回顶部
weibo_boer
C++ 语言 65,214 成员 250,514 内容