64,642
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
struct Try
{
double one;
int two;
};
int main()
{
Try temp[5];
temp[0] = {54.24, 62};
temp[1] = {65.72, 22};
temp[2] = {67.46, 58};
temp[3] = {97.86, 42};
temp[4] = {35.27, 53};
for(int i=0;i<5;i++)
cout << temp[i].one << "\t" << temp[i].two << endl;
return 0;
}
#include <iostream>
using namespace std;
struct Try
{
double one;
int two;
};
int main()
{
Try temp[5] = { {54.24, 62},
{65.72, 22},
{67.46, 58},
{97.86, 42},
{35.27, 53} };
for(int i=0;i<5;i++)
cout << temp[i].one << "\t" << temp[i].two << endl;
return 0;
}
Try temp[5] = {{54.24, 62},{65.72, 22},{67.46, 58},{97.86, 42},{35.27, 53}};