Afghanistan has surrounded by attackers. A truck enters the city. The driver claims the load is food and medicine from Pakistanis. Yasir is one of the soldier in Afghanistan. He doubts about the truck, maybe it's from the siege. He knows that a tag is valid if the sum of every two consecutive digits of it is even and its letter is not a vowel. If the tag is invalid then Yasir need to arrest the driver of the truck with invalid tab. If it is valid the truck is allowed inside the country.Can you help yasir in determine if he need to arrest or allow the truck?

 #include <stdio.h>
int main()
{int n=0,c=0;
char tag[9];
scanf("%s",tag);
while(n<8){
    if(tag[n+1]=='-')
    n+=2;
    else if((tag[n]+tag[n+1])%2==0)
    c++;
    n++;}
if(c>=4)printf("Allowed");
else printf("Arrest");
return 0;
}

Comments

Popular posts from this blog

Mukesh and Salima was looking to buy Organic Apples in the nearest fruits shop.But Shop Owner mixed the Hybrid apples in that Apple box. After sometimes Mukesh checking the box, he was confused among organic and hybrid apple. He started to count the hybrid apples. Please help to Mukesh Count the total number of hybrid apples in the box.

On one beautiful Sunday Selvan went to Aaron's house for exam preparation. They have decided to study Mathematics subject because they have exams by coming Monday, Aaron is a master in Mathematics but Selvan is not so good in Mathematics so James trained with Selvan for getting a high score in the exam. After teaching some problems to Selvan.Aaron have given some tasks to Selvan to solve .The problem is to convert input float into a double. Can you help Selvan in finding the solution ?

Elavenil has a chessboard with N rows and M columns. In one step, he can choose two cells of the chessboard which share a common edge (that has not been cut yet) and cut this edge. Formally, the chessboard is split into two or more pieces if it is possible to partition its cells into two non-empty subsets S1 and S2 (S1∩S2=∅, |S1|+|S2|=NM) such that there is no pair of cells c1,c2 (c1∈S1,c2∈S2) which share a common edge that has not been cut.Elavenil does not want the board to split into two or more pieces. Compute the maximum number of steps he can perform while satisfying this condition.