fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. struct BioSample {
  6. int number;
  7. double concentration;
  8. string type;
  9. };
  10.  
  11. void printSample(const BioSample &sample) {
  12. cout << "Номер образца: " << sample.number << endl;
  13. cout << "Концентрация: " << sample.concentration << endl;
  14. cout << "Тип: " << sample.type << endl;
  15. }
  16.  
  17. int main() {
  18. BioSample sample = {102, 0.06, "Контроль"};
  19. printSample(sample);
  20. return 0;
  21. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Номер образца: 102
Концентрация: 0.06
Тип: Контроль