ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1201. Which Day Is It?

For everyone who finds difficulties in the output
Posted by nullman 10 May 2002 18:29
Part of my <AC 0.02s> C++ code:

// 1201
#include <iostream.h>
#include <math.h> //for some calculations ;)

int d,m,y;

// Here are your subroutines

int main() {
  int flg=0;
  int i,j,lim,k=0;
  int a[10][10];
  char *w[]={"mon","tue","wed","thu","fri","sat","sun"};

  cin>>d>>m>>y;

  for (i=0;i<10;i++)
    for (j=0;j<10;j++) a[i][j]=0;

  // Here you put your data in a double array

  for (i=0;i<7;i++) {
    cout<<w[i];
    for (j=0;j<6;j++)
      if (a[i][j])
    if (a[i][j]==d) {
      if (d>9) cout<<" ["<<d<<"] ";
      else cout<<" [ "<<d<<"] ";
      flg=j<4;
    }
    else
      if (flg) {
        if (a[i][j]>9) cout<<" "<<a[i][j]<<" ";
        else cout<<"  "<<a[i][j]<<" ";
        flg=0;
      }
      else
        if (a[i][j]>9) cout<<"  "<<a[i][j]<<" ";
        else cout<<"   "<<a[i][j]<<" ";
    else cout<<"     ";
    cout<<endl;
  }
  return 0;
}
You seem to be GENIUS :))
Posted by Petar Zhivkov Petrov 4 Sep 2002 15:40