|
|
我编了一下一段程序,但是它老是说我:error C2144:
syntax error : missing ';' before type 'int'
fatal error C1004: unexpected end of file found
为什么啊?
#include <stdio.h>
#include <iostream>
using namespace std
int space(int a)
{
int s;
s = a*a;
return s;
}
int length(int a)
{
int c;
c = a * 4;
return c;
}
main()
{
int a,c,s;
cout << "请输入正方形的边长(整型):" <<endl;
cin >> a;
s = space(a);
c = length(a);
cout << "正方形的面积为" << s << ",周长为" << c << "." << endl;
}
|
|