Advertisement
Eather

Clock

Jun 19th, 2011
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.00 KB | None | 0 0
  1.                        /*Bismillahir Rahmanur Rahim*/
  2. //Template created by topcoder00
  3.  
  4. # include <list>
  5. # include <bitset>
  6. # include <algorithm>
  7. # include <sstream>
  8. # include <iostream>
  9. # include <cstdlib>
  10. # include <ctime>
  11. # include <set>
  12. # include <map>
  13. # include <cmath>
  14. # include <queue>
  15. # include <limits>
  16. # include <stack>
  17. # include <vector>
  18. # include <cstring>
  19. # include <cstdio>
  20. # include <fstream>
  21. using namespace std;
  22.  
  23. int pel(string s){string t;t=s;reverse(t.begin(),t.end());if(s==t)return 1;return 0;}
  24. string toString(int n){ostringstream ost;ost<<n;ost.flush();return ost.str();}
  25. int toInt(string s){int r=0;istringstream sin(s);sin>>r;return r;}
  26. bool isprime(int m){if(m<2) return 0;for( int i=2; i*i<=m ; i++)if(m%i==0)return 0; return 1;return 0;}
  27.  
  28. # define __(array,w)   memset(array,w,sizeof array)
  29. # define FOR(i, a, b) for (int i=a; i<b; i++)
  30. # define REP(i, a) FOR(i,0,a)
  31. # define all(c) (c).begin(), (c).end()
  32. # define sz(x) x.size()
  33. # define MAX INT_MAX
  34. # define pb push_back
  35. # define MP make_pair
  36. # define X first
  37. # define Y second
  38. # define SBS(s,a,b) (s).substr(a,b)
  39. # define UNQ(s) {sort(all(s));(s).erase(unique(all(s)),s.end());}
  40. # define rive(s) reverse(s.begin(),s.end())
  41. # define VI vector<int>
  42. # define VS vector<string>
  43. # define VC vector<char>
  44. # define out(a) cout<<#a<<"= "<<a<<endl;
  45.  
  46. void wait ( int seconds )
  47. {
  48.   clock_t endwait;
  49.   endwait = clock () + seconds * CLOCKS_PER_SEC ;
  50.   while (clock() < endwait) {}
  51. }
  52.  
  53. int main ()
  54. {
  55.     time_t rawtime;
  56.     tm * ptm;
  57.     time ( &rawtime );
  58.     ptm = gmtime ( &rawtime );
  59.  
  60.     char hh[4],mm[4],ss[4];
  61.  
  62.     int h=ptm->tm_hour+6,m=ptm->tm_min,s=ptm->tm_sec;
  63.  
  64.     while(1){
  65.     printf("%2d:%2d:%2d",h%12,m,s);
  66.     if(ptm->tm_hour+6 <12)cout<<" AM";else cout<<" PM";cout<<endl;
  67.     s++;if(s==60)m++,s=0;if(m==60)m=0,h++;if(h==12)h=0;
  68.  
  69.     cout<<"\n\n\n\n\n\n\n\n\n\nDesigned by Iftekhar ahmed eather,\nStudent of CSE (07 batch),\nBUBT, Mirpur";
  70.     wait(1);
  71.     system("cls");
  72.     }
  73.  
  74.  
  75.   return 0;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement