Skip to main content
code error
Source Link

C++

Never said we couldn't just take two other numbers and add 'em!
EDIT: Forgot to cast the ints as strings, now the code is really ugly!

#include <iostream>
#include <sstream> 

int main () {
     std::ostringstream convert1;
     std::ostringstream convert2;
     std::ostringstream convert3;
     std::ostringstream convert4;
     std::ostringstream convert5;
     std::ostringstream convert6;
     int fourfourint = 1 + 3;
     convert1 << fourint;
     std::string four = convert1.str();
     int eighteightint = 1 + 7;
     convert2 << eightint;
     std::string eight = convert2.str();
     int fifteenfifteenint = 2 + 13;
     convert3 << fifteenint;
     std::string fifteen = convert3.str();
     int sixteensixteenint = 3 + 13;
     convert4 << sixteenint;
     std::string sixteen = convert4.str();
     int twentythreetwentythreeint = 1 + 22;
     convert5 << twentythreeint;
     std::string twentythree = convert5.str();
     int fortytwofortytwoint = 21 * 2;
     convert6 << fortytwoint;
     std::string fortytwo = convert6.str();
     while (1) {
          std::cout << "\n" + four + " " + eight + " " + fifteen + " " + sixteen + " " + twentythree + " " + fortytwo;
     }
}

C++

Never said we couldn't just take two other numbers and add 'em!

#include <iostream>

int main () {
     int four = 1 + 3;
     int eight = 1 + 7;
     int fifteen = 2 + 13;
     int sixteen = 3 + 13;
     int twentythree = 1 + 22;
     int fortytwo = 21 * 2;
     while (1) {
          std::cout << "\n" + four + " " + eight + " " + fifteen + " " + sixteen + " " + twentythree + " " + fortytwo;
     }
}

C++

Never said we couldn't just take two other numbers and add 'em!
EDIT: Forgot to cast the ints as strings, now the code is really ugly!

#include <iostream>
#include <sstream> 

int main () {
     std::ostringstream convert1;
     std::ostringstream convert2;
     std::ostringstream convert3;
     std::ostringstream convert4;
     std::ostringstream convert5;
     std::ostringstream convert6;
     int fourint = 1 + 3;
     convert1 << fourint;
     std::string four = convert1.str();
     int eightint = 1 + 7;
     convert2 << eightint;
     std::string eight = convert2.str();
     int fifteenint = 2 + 13;
     convert3 << fifteenint;
     std::string fifteen = convert3.str();
     int sixteenint = 3 + 13;
     convert4 << sixteenint;
     std::string sixteen = convert4.str();
     int twentythreeint = 1 + 22;
     convert5 << twentythreeint;
     std::string twentythree = convert5.str();
     int fortytwoint = 21 * 2;
     convert6 << fortytwoint;
     std::string fortytwo = convert6.str();
     while (1) {
          std::cout << "\n" + four + " " + eight + " " + fifteen + " " + sixteen + " " + twentythree + " " + fortytwo;
     }
}
removed potentially invalid numbers, just in case
Source Link

C++

Never said we couldn't just take two other numbers and add 'em!

#include <iostream>

int main () {
     int four = 1 + 3;
     int eight = 1 + 7;
     int fifteen = 12 + 14;13;
     int sixteen = 23 + 14;13;
     int twentythree = 1 + 22;
     int fortytwo = 121 +* 41;2;
     while (1) {
          std::cout << "\n" + four + " " + eight + " " + fifteen + " " + sixteen + " " + twentythree + " " + fortytwo;
     }
}

C++

Never said we couldn't just take two other numbers and add 'em!

#include <iostream>

int main () {
     int four = 1 + 3;
     int eight = 1 + 7;
     int fifteen = 1 + 14;
     int sixteen = 2 + 14;
     int twentythree = 1 + 22;
     int fortytwo = 1 + 41;
     while (1) {
          std::cout << "\n" + four + " " + eight + " " + fifteen + " " + sixteen + " " + twentythree + " " + fortytwo;
     }
}

C++

Never said we couldn't just take two other numbers and add 'em!

#include <iostream>

int main () {
     int four = 1 + 3;
     int eight = 1 + 7;
     int fifteen = 2 + 13;
     int sixteen = 3 + 13;
     int twentythree = 1 + 22;
     int fortytwo = 21 * 2;
     while (1) {
          std::cout << "\n" + four + " " + eight + " " + fifteen + " " + sixteen + " " + twentythree + " " + fortytwo;
     }
}
Source Link

C++

Never said we couldn't just take two other numbers and add 'em!

#include <iostream>

int main () {
     int four = 1 + 3;
     int eight = 1 + 7;
     int fifteen = 1 + 14;
     int sixteen = 2 + 14;
     int twentythree = 1 + 22;
     int fortytwo = 1 + 41;
     while (1) {
          std::cout << "\n" + four + " " + eight + " " + fifteen + " " + sixteen + " " + twentythree + " " + fortytwo;
     }
}