Introduction to programming 40153 
  CE Department- Sharif University of Technology 1 - Group 3 

  Main Menu


  1386-11-20 February 09, 2008 10:01 AM  
I have just uploaded your final grades.


  1386-11-19 February 08, 2008 10:45 PM  
Hello Boys,

  Everything is over and final results of exercises can be found in Grades menu. I made an amnesty and gave a generic additional point to all (more to honest guys).

  Don't cheat anymore! ;-) There's always someone watching you (even if you don't see him). His eyes are not awesome -- He can close his eyes upon your request at anytime, but it's not always easy to convince him to re-open the eyes.
  I wish you success in entire life.

Be Fine,

  1386-11-13 February 02, 2008 09:37 AM  

  Grades of All 4 series of HomeWorks (HW-1 was on paper and HW-2, HW-3, HW-4 were coding ones) are now ready and can be found in the attachment Grades area.
  Please take a look at it. The details (i.e. why you got 45 of HW-2 for example) can be found in separate sheets of Excel file. Navigate between sheets by clicking on sheet name in bottom menu of the page or "Control+PageDown" key sequence of keyboard.

  My grading policy for each problem was to give 10 inputs to your code and compare its printed values with the expected result. If the result of your program was correct, I wrote C; if wrong, I wrote W; and if it terminated unexpectedly (a crash somehow) or didn't answer in 1 second (and I killed it thereafter), I wrote R. This way, a detail of CCWWWRRRRR means that your code worked properly for first 2 test-cases but printed incorrect output for tests 3, 4 and 5 and finally crashed or Timed-Out on next 5 tests. Thus, you get 20 out of 100 in this problem.
  You can download all the test-data I used to grade your 4+4+3 codes (HW2, 3 and 4 respectively) from here (university's website is really slow these days). I just removed output of last 4 tests of P32 as they were large indeed (~5MB). All the rests are what I used. Also, my own codes are there, if you ever wanted to see.
  Please test your programs again using my test-data. If you found everything is fine, smile and say goodbye! Don't worry if it's too low, I'll raise all grades (namely, nemoodar!) a bit.

  Otherwise, If you think something is wrong (maybe, Aideen's fault), please read these notes and then, if yet needed, follow the mentioned procedure.


   * Every cell of excel that has a red triangle in its top right corner contains my comments. Hold your mouse cursor on it to view the comment.
   * If you've got COMPILE_ERR (compilation error), it means that your code was not compiled properly using g++ compiler. I'm not responsible if you used any strange compiler. I'd warned about it in page 1 (after cover) of every exercise set.
   * If your objection is about one or two test of one program of one series, please forget that negligible points.
   * If you have any problem with your HW-1 grade (on-sheet exercise), please contact Mr. Taghaddosi {mohsen.taghaddosi[in]gmail}. I'm totally away from that exercises.
   * If you got -100 (red row) in any exercise set, it means that I believe you've cheated/copied at least one code from someone else. I've noted that person(s) as a comment in last column of the row. This way, If you think that you have not cheated and I have blamed you in a wrong manner, then Please be warned that if I prove my reasons (for blaming you) and reject your claim, that -100 would become -200. Thus, please don't try to fool me again unless you know what you are doing. I'd warned enough about the result of cheating. I'm sorry to see 11+25 students have cheated on HW-3 and HW-4. Minus grade (i.e. one who got -1 out of 4) won't be raised to zero! It would be added to your final grade as -1 (i.e. decrease one point from your exams).


   * Just leave an email (no phone-call, no face-to-face talk, no SMS) to me {aideen[in]gmail} (neither Mr. Mousavi nor other TAs, other accounts, etc.) with subject: "C++ Objection, HW-?, 8610????", (where question marks are replaced with proper digits), and describe your problem to me. Please write in Persian or English, as reading Fingilish is really difficult.
   * Write one email for each SERIES of homeworks. For example, if you think something is wrong with your grade on P21, P23 and P41 write one email for HW-2 (P21 and P23) and one for HW-4 (P41).
   * The due for sending objections is Tuesday (16th of Bahman) at 23:59. Any late or inappropriate-subjected objection will be discarded.

Finally, please inform your friends, of this grades (by phone, tongue or any other media).

Be Fine,

  1386-11-12 February 01, 2008 12:26 PM  
Dear Students
1- Time for sending project to, has been extended to 13 of bahman!
2- Project Scheduling has been changed, you can find new Project Scheduling in Resources Section. all project will be presented in Wed(17 of bahman)

  1386-11-10 January 30, 2008 08:35 AM  
The schedules of delivering projects are available in Resource section
If your project is not listed, send an E-Mail to


  1386-11-01 January 21, 2008 06:37 AM  
Your final exam. grades is uploaded in 'grades' part. I will set a time for you to see your papers.


  1386-10-30 January 20, 2008 09:18 PM  
Send an E-Mail to containing your team members' names and Student ID numbers and your project name up to 2nd of Bahman


  1386-10-23 January 13, 2008 08:34 AM  
Dear Students
The deadline for sending final projects has been extended (from 7 of bahman ) to 11 of  bahman.
--Ali Eslamifar

  1386-10-10 December 31, 2007 09:14 PM  
You can Download Complete Specification of your projects in Resources Section.

--Ali Eslamifar

  1386-10-10 December 31, 2007 10:59 PM  
The deadline for HW-4 is postponed to 23:59:59 of Thursday 13th of Day!
Also, here are some hints:


read the very-big-numbers as strings. it's an easy job! see:
     char s[100];
     scanf("%s", s); // or cin >> s
     int n = strlen(s); // n would be its length


get a global boolean array, namely mark (to save which words are already used and which are not) and update it in your recursive function. see:
  for (int i=0; i<n; i++)
     if (!mark[i]) {
         mark[i] = true;
         go(k+1); // find k+1th ordered word
         mark[i+1] = false;


Try to memorize the previously calculated circumstances. a good job can be to have a function long long f(int n, int from, int to) which return number of turns it takes to move n disks from from pile to pile to. and in order to avoid repetitions, you can save the results of this function (which calculated) into a 3 dimensional array (of d[n][from][to]) everytime you calculated it and read that in constant time instead of recalling the time-consuming function!
This way, the job would be done in O(30*3*3*6) ~ 2000 actions rather than 2^30 moves.
However, if you couldn't do that, post your simulating code (which takes O(moves) ) and you may get half the score.

Have fun,

  1386-10-07 December 28, 2007 04:02 PM  
Codes of Problems for TA class is available in Resources section.


  1386-10-02 December 23, 2007 09:38 PM  
Your homework #4 is uploaded in Assignments area. It's due to Tuesday 11th of Day.


  1386-10-02 December 23, 2007 09:39 PM  
Two issues about HW-3

   * A change in constraints: MAX_N of P32 (subsets) will be 20 instead of 30. Thanks to Mahdi A. for noting it!
   * A typo in samples: Substitute all L and M characters in output of second sample of P34 (Simulating BinarySearch). It was my typing error (nee as typo). Thanks to TA-Class attendances!

Have Fun,

  1386-09-19 December 10, 2007 11:48 AM  
Projects of this course will be explained on Saturday (24 of azar) at the beginning of the class.
Be on time!

  1386-09-15 December 06, 2007 07:01 PM  
Your homework #3 is uploaded in Assignments area. It's due to Saturday 1st of Day.

Have Fun,

  1386-09-13 December 04, 2007 12:12 PM  
Because of a problem, tomorrow TA class doesn't be held.I try to have another class instead of it later.

  1386-09-05 November 26, 2007 04:19 AM  
Your midterm's grades is uploaded


  1386-08-30 November 21, 2007 12:24 PM  
The slides of this TA class(30th Aban) is uploaded.

  1386-08-23 November 14, 2007 06:53 AM  
   Homework #2 (First coding exercise) is just uploaded in Assignments part. I'm sorry for my delay in preparing it.
It's due to one week from now (i.e. 23:59:59 of Sunday, 27 of aban).


PS. Try to read it before coming to TA class on Thursday Tuesday (PPS. I was sleepy!), so you can ask your questions about it (either technically or algorithms and codings) there at class.

  1386-08-19 November 10, 2007 10:54 AM  
The other TA class will be held on :
Wednesdays, 10:30-12 , alef 17.
You can also ask your questions, preparing for midterm exam on this wednesday(23th Aban).


  1386-08-19 November 10, 2007 09:11 AM  
Join cpp8613 group of google to get news!

Second series of assignments (1st coding one) will be uploaded by tonight. It's due to seven days after, Monday 21st of Aban.

Have Fun,

  1386-08-01 October 23, 2007 09:51 AM  

  • New Resources (NotePad++ and Dev C++) is uploaded in resources part.

  • The TA class will be held on Alef-18, every Tuesday at 13:30-15:00. Please attend seriously!

  • Slides of today TA class (1st of Aban) is uploaded in resources part.


  1386-07-16 October 08, 2007 07:55 AM  
Resources uploaded.


  1386-07-10 October 02, 2007 08:52 AM  
Welcome to the Introduction to programming course Website

Hamid Mousavi
(h_mousavi (at)

3 Units
Sat&Mon 9-10:30
Room: 21 (Ebn-e Sina)

 This website is visited 8255 times since October 2007. Updated Monday 2020-09-07 09:12