fork download
  1. #include <iostream>
  2.  
  3. int main() {
  4. int total_colonies = 300; // Всего колоний
  5. int target_colonies = 45; // Колонии с белком
  6.  
  7. double percentage = (static_cast<double>(target_colonies) / total_colonies) * 100.0;
  8.  
  9. std::cout << "Всего колоний: " << total_colonies << std::endl;
  10. std::cout << "Колоний с белком: " << target_colonies << std::endl;
  11. std::cout << "Процент колоний с белком: " << percentage << "%" << std::endl;
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Всего колоний: 300
Колоний с белком: 45
Процент колоний с белком: 15%