Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <string>
- #include <iostream>
- #include <iomanip>
- using namespace std;
- struct HERNIA
- {
- string COLOR;
- double FREQ;
- int NUM;
- }spectr[7];
- void InitRainbow(string *c, int *n, double *f);
- void OutStruct();
- int main(int argc, char **argv)
- {
- system("chcp 1251 > nul"); // Руссификация сообщений
- setlocale(LC_ALL, "Russian");
- string NAME[7]= {"Каждый","Охотник","Желает","Знать","Где","Сидит","Фазан"};
- int Num[7]= {0,10,20,30,40,50,60};
- double Freq[7]= {3.3, 4.3, 5.2, 5.4, 5.6, 6.5, 7.4};
- InitRainbow(NAME, Num, Freq);
- OutStruct();
- system("pause"); // system("pause > nul");
- return 0;
- }
- void InitRainbow(string *c, int *n, double *f)
- {
- for (int a=0; a<7; a++)
- {
- spectr[a].COLOR= c[a]; spectr[a].FREQ= f[a]; spectr[a].NUM= n[a];
- }
- }
- void OutStruct()
- {
- cout << setw(10) << "Цвет" << setw(10) << "Частота" << setw(10) << "Номер" << endl;
- for (int a=0; a<7; a++)
- {
- cout << setw(10) << spectr[a].COLOR << setw(10) << spectr[a].FREQ << setw(10) << spectr[a].NUM << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement