Guest User

Untitled

a guest
Jan 11th, 2016
119
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "testlib.h"
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. #define forn(i, n) for (int i = 0; i < int(n); i++)
  7. #define x first
  8. #define y second
  9. #define pb(a) push_back(a)
  10. #define all(a) (a).begin(), (a).end()
  11. #define sz(a) int((a).size())
  12. #define mp(x, y) make_pair((x), (y))
  13.  
  14. typedef long long li;
  15.  
  16. inline li toLong(char* s) {
  17.     li ans = 0;
  18.     while (*s) ans = ans * 10 + int(*s - '0'), s++;
  19.     return ans;
  20. }
  21.  
  22. typedef pair<int, int> pt;
  23.  
  24. int main(int argc, char* argv[]) {
  25.     registerGen(argc, argv, 1);
  26.  
  27.     int n = atoi(argv[1]);
  28.     int m = atoi(argv[2]);
  29.     int per = atoi(argv[3]);
  30.  
  31.     cout << n << ' ' << m << endl;
  32.     forn(i, n) {
  33.         forn(j, m) {
  34.             int v = rnd.next(0, 100);
  35.             if (v <= per) putchar('.');
  36.             else putchar('*');
  37.         }
  38.         puts("");
  39.     }
  40.  
  41.     return 0;
  42. }
RAW Paste Data