c++ 结构体
#include <iostream> using namespace std; struct Distance { int feet; float inches; }; int main() { Distance d1; cout << "\n Enter feet ::: "; cin >> d1.feet; cout << "\n Enter inches ::: "; cin >> d1.inches; cout << "\n Feet : " << d1.feet; cout << "\n Inches : " << d1.inches; return 0; }