Data type: long long integer Algorithm: After taking the input, firstly sort the values, such X <= Y <= Z if ( X + Y <= Z ) then print (Invalid) // Sum of two smaller sides is greater than larger sides. Else if (X = Y and X = Z ) then print (Equilateral) … Continue reading ACM (UVa) : 11479
Data type: long Integer Algorithm: hmm … which sorting algorithm is going round in ur head ?? Quick sort !! or sth more efficient !! while writing this post, till now I can efficiently use only bubble sort and rarely I did use insertion sort. Then, what abt our current problem !! I have used … Continue reading ACM (UVa) : 11462
Data type: long Integer Algorithm: Depends on compiler XOR sign could be either (^) or (XOR), capital letter.
Take input as a string if u take input as character by character then it may cause input/output difficulties. Let, char A   // 2-D character array scanf (“%s”, A ); // this will take input as string, save it in 0 indexed row (means, first row) and use sufficient column Traverse each cell … Continue reading ACM (UVa) : 11520
If we consecutively use scanf () and gets () then, it may create some input/output problem. For example, Digit is an integer variable A is a character array scanf (“%ld”, & Digit); gets (A); printf (“%ld %s”, Digit, A); Let, the input : 12 AABEDE what will be the output ?? output will be just: … Continue reading ACM (UVa) : 11530
Data type: Integer Process: Read the whole text as String Then, distinguish the Letter and Digits In C/C++, u can use atoi () function, under <stdlib.h>, to convert string to integer
Data type: Long Integer Algorithm: Input: N N *= 567 N /= 9 N +=7492 N *= 235 N /=47 N -=498 Output: tens column of N Tens Column means, if The final result is : 856253, then output: 5 if : 15324, output: 2 if : 163, output: 6 if : 74, output: 7 … Continue reading ACM (UVa) : 11547