SHARE
TWEET

Bài 4 Tin

anhkiet2507 Apr 5th, 2019 6,438 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Bài 4: In bảng nhân
  2. #include <stdio.h>
  3. #include <string>
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int main() {
  8.     string s;
  9.     for (int j = 0; j < 10; j++) {
  10.         for (int i = 1; i <= 5; i++) {
  11.             s = to_string(i) + " x " + to_string(j) + " = " + to_string(i*j);
  12.             printf("%20s", s.c_str());
  13.         }
  14.         printf("\n");
  15.     }
  16.     printf("\n");
  17.     for (int j = 0; j < 10; j++) {
  18.         for (int i = 6; i <= 10; i++) {
  19.             s = to_string(i) + " x " + to_string(j) + " = " + to_string(i*j);
  20.             printf("%20s", s.c_str());
  21.         }
  22.         printf("\n");
  23.     }
  24.     system("pause");
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top