這是我的程式碼
#include<iostream>
#include<cmath>
#include<cstdlib>
using namespace std;
int main()
{
double c,a1,a2,b,d,m1,m2,d1,d2;
while(cin>>a1>>m1>>d1>>a2>>m2>>d2)
{
b=(int)pow((double)a1,m1);
c=pow(d1,0.5);
if(a2<0)
{
d=a2*(-1);
}
else
{
d=a2;
}
cout<<b<<endl;
printf("%.3f\n",c);
cout<<d<<endl;
cout<<m2<<endl;
}
return 0;
}
請各位大大看一下謝謝
code_1484652.cpp: In function ‘int main()’:
code_1484652.cpp:25: error: ‘printf’ was not declared in this scope
code_1484652.cpp: In function ‘int main()’:
code_1484652.cpp:25: error: ‘printf’ was not declared in this scope
樓上大大顯然的亂數那邊也有問題喔!
顯然你家電腦有問題喔傳2次
這是我的程式碼
#include
#include
#include
using namespace std;
int main()
{
double c,a1,a2,b,d,m1,m2,d1,d2;
while(cin>>a1>>m1>>d1>>a2>>m2>>d2)
{
b=(int)pow((double)a1,m1);
c=pow(d1,0.5);
if(a2<0)
{
d=a2*(-1);
}
else
{
d=a2;
}
cout< printf("%.3f\n",c);
cout< cout< }
return 0;
}
請各位大大看一下謝謝
原因是這個 print是 c 的函數
code_1484652.cpp:25: error: ‘printf’ was not declared in this scope
這是我的程式碼
#include
#include
#include
using namespace std;
int main()
{
double c,a1,a2,b,d,m1,m2,d1,d2;
while(cin>>a1>>m1>>d1>>a2>>m2>>d2)
{
b=(int)pow((double)a1,m1);
c=pow(d1,0.5);
if(a2<0)
{
d=a2*(-1);
}
else
{
d=a2;
}
cout< printf("%.3f\n",c);
cout< cout< }
return 0;
}
請各位大大看一下謝謝
原因是這個 print是 c 的函數
code_1484652.cpp:25: error: ‘printf’ was not declared in this scope