Saturday 30 April 2016

Solution of URI 1564 :: Brazil World Cup


Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

/**Bismillahir Rahmanir Rahim.**/

#include <stdio.h>
int main()
{
    int a,b,c;
    while(scanf("%d" ,&a)!=EOF)
    {
        if(a==0)
            printf("vai ter copa!\n");
        else if(a>0)
            printf("vai ter duas!\n");
    }
    return 0;
}

3 comments:

  1. If I write the code in c++,then it will show error.
    I have written (cin>>a) replacing scanf("%d" ,&a).
    Please give the solution of it Sir.

    ReplyDelete
    Replies
    1. #include
      using namespace std;
      int main()
      {
      int n;
      while(cin>>n)
      {
      if(n>0)
      {
      cout<<"vai ter duas!\n";
      }
      else
      {
      cout<<"vai ter copa!\n";
      }
      }
      return 0;
      }

      Delete

Note: only a member of this blog may post a comment.