fork download
  1. #include <iostream>
  2. using namespace std;
  3. struct Stuff{
  4. int power;
  5. int voltage;
  6. string brand;
  7. };
  8. int main() {
  9.  
  10. Stuff stuff1,st;
  11. stuff1.power=10;
  12. stuff1.voltage=10;
  13. cin>>st.power>>st.voltage;
  14. cout<<stuff1.power<< " "<<st.power;
  15.  
  16. Stuff x[3];
  17. for(int i =0;i<3;i++){
  18. cin>>x[i].power>>x[i].voltage;
  19. x[i].brand="Bosch";
  20. }
  21. cout<<"____"<<endl;
  22. for(int i =0;i<3;i++){
  23. cout<<x[i].power<<" "<<x[i].voltage<<" "<<x[i].brand[0]<<endl;
  24. }
  25.  
  26. // your code goes here
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5308KB
stdin
20 100
30 200
40 500
50 120
stdout
10 20____
30 200 B
40 500 B
50 120 B