我在显示注册表中输入的数据时遇到问题。我编写的以下程序仅显示最后一个寄存器。( ziua=day , inregistrari=registers, data=date (ex. 03.02.2013))
#include <iostream>
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main()
{
char ziua[30],data[30],inregistrari[90];
int n,i;
cout<<"INPUT DATA"<<endl;
system("Pause");
cout<<"\nEnter the day in which you want to perform the register: ";
cin>>ziua;
cout<<"\nDATE:";
cin>>data;
cout<<"\nEnter the number of registers you wanna perfom for the day "<<ziua<<":";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"\nRegister "<<i<<":";
gets(inregistrari);
}
cout<<"The data for the day of "<<ziua<<" are the following: ";
cout<<"\nDATE: "<<data;
for(i=1;i<=n;i++)
cout<<"\n"<<inregistrari;
getch();
}