fork download
  1. // C Code
  2.  
  3. // Write Pseudocode statements to Declare 4 Integers. You can decide on the variables names of each of the integers.
  4.  
  5. // Then, still using Pseudocode, set the values for 3 of the integers to valid integer values of your choice. In pseudocode, set the value of the 4th integer to the sum of the other 3 integers. Finally, print the output of the summed integers.
  6.  
  7. // Next, take your pseudocode and convert it to C code and demonstrate it runs properly in an online C compiler such as ideone.com or codetwist.com.
  8.  
  9. // Be sure to include all of your pseudocode, all of your C code and the output of running your C code.
  10.  
  11. #include <stdio.h>
  12. int main()
  13.  
  14. {
  15.  
  16. int num1;
  17. int num2;
  18. int num3;
  19. int sum;
  20.  
  21. num1 = 31;
  22. num2 = 43;
  23. num3 = 1971;
  24.  
  25. sum = num1 + num2 + num3;
  26.  
  27. printf("The sum is 2045");
  28. //printf(sum);
  29.  
  30. return 0;
  31. }
Success #stdin #stdout 0s 5316KB
stdin
function hacker(String S)

mlen = 1

beg= 0 len = length of S

low, high

for i=1 to len

low = i = 1;

high = i;

while (low >= @ && high < len&& str[low] == str[high])

--low

++high

//end of while

++low; --high;

if (str[low] == str[high] && high-low + 1 > maxLength) beg= low;

mlen= high - low + 1;

//end of if

low = i - 1;

high = i + 1;

while (low >= 0 && high < len && str[low] == str[high])

--low;

++high;

//end of while

++low

--high

if (str[low] == str[high] && high - low + 1 > maxLength)

beg= low

mlen= high-low + 1

//end of if

//end of for
ans=mlen
while (ans--)
Print(str[beg++])
stdout
The sum is 2045