Code

#include
#include
using namespace std;

int main()
{
 stack s;

 cout << "Stack size :: " << s.size() << endl;
 
 for(int i=1; i<=5; i++)
  s.push(i);
 
 cout << "Stack size :: " << s.size() << endl;

 cout << "Elements into Stack :: " << endl;
 while(!s.empty())
 {
  cout << s.top() << endl;
  s.pop();
 }

 if(s.empty())
  cout << "Stack is empty..." << endl;
 else
  cout << "Not empty..." << endl;

 return 0;
}

Output

Stack size :: 0
Stack size :: 5
Elements into Stack :: 
5
4
3
2
1
Stack is empty...

Code

#include
#include
using namespace std;

int main()
{
 queue q;

 cout << "Queue size :: " << q.size() << endl;
 
 for(int i=1; i<=5; i++)
  q.push(i);
 
 cout << "Queue size :: " << q.size() << endl;

 cout << "Elements into queue :: " << endl;
 while(!q.empty())
 {
  cout << q.front() << endl;
  q.pop();
 }

 if(q.empty())
  cout << "Queue is empty..." << endl;
 else
  cout << "Not empty..." << endl;

 return 0;
}

Output

Queue size :: 0
Queue size :: 5
Elements into queue :: 
1
2
3
4
5
Queue is empty

http://uva.onlinejudge.org/external/101/10100.html

take two 2D char array and store the words of each of two input strings. here word means group of "a-z", "A-Z" and "0-9". Also ignore other char.
after that run lcs algo between these two array.
print "blank!" if any of the input is blank line..... if lcs is 0 then print like other non zero answer

http://uva.onlinejudge.org/external/101/10195.html

  1. Use Heron's formula to calculate the area of the triangle
  2. r = 2A/(a+b+c);
  3. Critical test case. Input : 0 0 0, Output : The radius of the round table is: 0.000

http://uva.onlinejudge.org/external/114/11462.html

  1. Use scanf to take input
  2. sort using the sort function of #include<algorithm> header file]
  3. Use a trick to print the ages bcz after the last element there will be newline rather than blank space

http://uva.onlinejudge.org/external/109/10991.html

  1. connect the three center of the circles, then u will have a tringle where a = r1+r2, b=r2+r3, c=r3+r1. Find the area of the triangle using heron's formula
  2. use cosine formula to find out the angle between the connecting lines and find out the area which of arc 
  3. finialy minus these with the value of the triangle and print the value. 

http://uva.onlinejudge.org/external/103/10347.html


Use the following formulas ::
area = (4*sqrt(o*sqrt( o*(o-m1)*(o-m2)*(o-m3) ) ))/3
o = (m1+m2+m3)/2;

do check for invalid triangle. and printf -1.000 for that.

http://uva.onlinejudge.org/external/107/10783.html

Just run a loop from a to b and add them with another variable s(initial value of s=0). Plz do check for either it is odd number or not.....

http://uva.onlinejudge.org/external/118/11805.html

There are 2 ways to solve the problem.

One
Using for loop upto no of passes while increasing the value of player no.

Two
Do simple calculation using no of passes, no player & starting point.

About this blog

Hi! I'm Md Fasihul Kabir Rafi from Bangladesh, studying in Ahsanullah University of Science & Technology in Computer Science & Engineering Department. This is my personal blog. I want to share my experince (Though I don't know anything) with all of you.

I will constantly gonna post lost of helpful and interesting things for you. So please keep visiting my blog and also visite my website. If you want to email me then mail me at the following mail address, I will get touch with you ASAP.

Website : www.aboutrafi.net23.net

Email : blog@aboutrafi.net23.net