fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. string s {"abcd "};
  8. int suma=0;
  9. for(char znak:s){
  10. cout<<static_cast<int> (znak)<<endl;
  11. suma+=znak;
  12. }
  13. cout<<suma<<endl;
  14. }
  15.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
97
98
99
100
32
426