Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <cstdio>
- #include <cstdlib>
- #ifdef STDPOW
- int pow2(double pw)
- {
- return pow(2,pw);
- }
- #endif
- #ifdef MYPOW
- int mypow2(int pw)
- {
- int out=1;
- for(int cur=0; cur<pw; cur++)
- out*=2;
- return out;
- }
- int pow2(int pw)
- {
- return mypow2(pw);
- }
- #endif
- int main(int, char** argv)
- {
- for(int occ=0; occ<atoi(argv[1]); occ++)
- {
- for(int i=0; i<atoi(argv[2]); i++)
- printf("%d\t", pow2(i));
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement