Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- #include <fstream>
- #include <stdio.h>
- #include <string.h>
- #include <iomanip>
- #include <cstdlib>
- using namespace std;
- int main(int argc, char** argv) {
- setlocale(LC_ALL, "RUSSIAN");
- const char separator = ' ';
- const int headerWidth = 20;
- const int nameWidth = 14;
- string processor[10], frequency[10], ram[10], type[10];
- int count;
- int i = 0;
- cout << "Введите кол-вол данных: " << endl;
- cin >> count;
- while (i != count){
- cout << "Введите данные " << i+1 << "-го процессора (Название процессора, частоту, RAM, тип)." << endl;
- cin >> processor[i] >> frequency[i] >> ram[i] >> type[i];
- i++;
- }
- system("cls");
- //HEADER
- cout << left << setw(nameWidth) << setfill(separator) << "";
- cout << left << setw(nameWidth) << setfill(separator) << "";
- cout << left << setw(headerWidth) << setfill(separator) << "ХАРАКТЕРИСТИКИ ПЭВМ";
- cout << "\n";
- cout << left << setw(nameWidth) << setfill(separator) << "";
- cout << left << setw(nameWidth) << setfill(separator) << "Процессор";
- cout << left << setw(nameWidth) << setfill(separator) << "Частота (Mgz)";
- cout << left << setw(nameWidth) << setfill(separator) << "RAM (mb)";
- cout << left << setw(nameWidth) << setfill(separator) << "Type";
- cout << "\n";
- //
- i = 0;
- while(i != count){
- cout << left << setw(nameWidth) << setfill(separator) << "";
- cout << left << setw(nameWidth) << setfill(separator) << processor[i];
- cout << left << setw(nameWidth) << setfill(separator) << frequency[i];
- cout << left << setw(nameWidth) << setfill(separator) << ram[i];
- cout << left << setw(nameWidth) << setfill(separator) << type[i];
- cout << "\n";
- i++;
- }
- cout << left << setw(nameWidth) << setfill(separator) << "";
- cout << left << setw(nameWidth) << setfill(separator) << "Тип: C - CISC-процессор, R - RISC-процессор";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement