UVA: 490 - Rotating Sentences - Solution in C/C++


Problem Name:  Rotating Sentences

Problem Source: Uva Online Judge

Problem No: 490

Problem Difficulty: Easy

Problem Link: Here

Submit Solution Here

Important Point

  • You must have to assign a white space to every null value of every sentence.
  • Top sentence will be on right most and last sentence will be on left most.
  • You have to print every character including white space. 
Source Code


 #include<bits/stdc++.h>  
 using namespace std;  
 //Code Written by Al Shah Reyaj  
 //BSMRSTU, Gopalganj, Bangladesh  
 int main()  
 {  
   char s[105][105];  
   int c=0,m=0,l;  
   for(int i=0;i<105;i++)  
   {  
     for(int j=0;j<105;j++) s[i][j]=' ';  
   }  
   while(gets(s[c]))  
   {  
     l=strlen(s[c]);  
     if(l>m) m=l;  
     c++;  
   }  
   for(int i=0;i<m;i++)  
   {  
     for(int j=c-1;j>=0;--j)  
     {  
       if(s[j][i]=='\0') cout<<' ';  
       else  
       cout<<s[j][i];  
     }  
     cout<<endl;  
   }  
   return 0;  
 }  


Thanks for Reading This. Check our more Activities.

UVA: 100 - The 3n + 1 problem - Solution in C/C++



Problem Name: The 3n+1 problem

Problem Source: Uva Online Judge

Problem No: 100

Problem Difficulty: Easy

Problem Link: Here

Submit Solution Here

Important Point

  • i can be bigger than j. if i is bigger than j then you have to run the loop from j to i;
  • i and j in the output must be same as input.
  • You have to count n=1 case.
  • You don't have to use long long. int is enough.
  • You have to run the loop including i and j.

Source Code


#include<bits/stdc++.h>  
 using namespace std;  
 //Code Written by Al Shah Reyaj  
 //BSMRSTU, Gopalganj, Bangladesh  
 /* ******* ****    **    *******  
   *   *  **    * *      *  
   *  *  **   *  *     *  
   ****   **   ********    *  
   * *   **  *    *   *  
   *  *   **  *     *  *  
   *  *  **** *      * *******  
 */  
 int fin(int n,int c)  
 {  
   c++;  
   if(n==1) return c;  
   if(n%2!=0) fin((3*n)+1,c);  
   else fin(n/=2,c);  
 }  
 int main()  
 {  
   int a,b;  
   while(cin>>a>>b)  
   {  
     int m=0;  
     int x=a,y=b;  
     if(a>b)  
     {  
       int x=a;  
       a=b;  
       b=x;  
     }  
     for(int i=a; i<=b; i++)  
     {  
       int l=fin(i,0);  
       if(l>m) m=l;  
     }  
     cout<<x<<" "<<y<<" "<<m<<endl;  
   }  
   return 0;  
 


Thanks for Reading This. Check our more Activities.

Download The Sims 4 free for PC (torrent/8.8GB)

May be nothing to tell about The Sims 4.

Download the game and Enjoy it.



  • Minimum Processor: 2.0 GHz Intel Core 2 Duo, 2.0 GHz AMD Turion 64 X2 TL-62 or equivalent. See notes on shader model 3.0 to find out how to see your processor model).
  • Minimum Memory: At least 2 GB RAM
  • Disk Space: 10GB of free space for game data, creations, and saves, more with each Expansion Pack (1GB+ each)
  • DVD-Rom: Only required if you bought a disk copy. DLC are added to the game via download.
  • Minimum Graphics Card: 128 MB of Video RAM and support for Pixel Shader 3.0. NVIDIA GeForce 6600 or better, ATI Radeon X1300 or better, Intel GMA X4500 or better
    If you have, for example, an Nvidia GTX 7800, it will be superior.
  • Sound/DirectX DirectX 9.0c compatible. 99% will not have a problem with these unless using a very old version of windows. If you're on Windows XP, make sure your version supports it. Hit Start > Run, type dxdiag and press enter.
You Have Download with torrent.

For more information about downloading with torrent.

Here are some gameplay picture.


Image result for the sims 4 gameplay
Magnet Link(torrent/8.8GB)
Thanks for visiting.

How to Download Movies, Games, Software, Songs for Free with Torrent

Hello, Everyone...

Welcome back again to Blog-tech.


Now, in this post I'm gonna show you how to download anything for free.


WARNING: This is Illegal, So Download with own risk. 
RECOMMENDATION: Use a VPN while downloading.

Search for free VPN

First, Download and Install Utorrent.

Then visit these sites for downloading

Movies


Games, Software, Movies, TV Shows




There are a lot of site for downloading. Just search on Google.

After going to any site you will get magnet link to download. Just click on these link. you will be automatically gone to utorrent. Select directory and hit Ok to download. 

Thanks Everyone.

DOWNLOAD PC GAMES

DOWNLOAD PC APPS