CAR problem

xiaoxiao2021-03-05  26

Design a structure called Car, store the following information: producers, year. How many cars are asked to users. Subsequently, New creates a dynamic array of corresponding quantity CAR structures. The program prompts users to enter each car. What year producer. The final program shows each structure content. Operation is as follows: How much Cars do you wish to catalog? 2car # 1: please enter the make: hudson hornetplease enter the year name: 1952car 2 #; please enter the make : Kaiserplease enter the year name: 1951 HUDS YOUR Collection: 1952 hudson hornet1951 kaiser ==================================== =================================================================================

#include using namespace std; struct cartag {int year; char make [80];}; int main () {int N; cout << "How much Cars do you wish to catalog?" << endl; cin >> n; cartag * array = new cartag [n]; int i = 0; while (i > array [i] .make; cout << "please enter the year name:"; cin >> array [i] .year; i ;} i = 0; While (i

转载请注明原文地址:https://www.9cbs.com/read-35640.html

New Post(0)