View Code of Problem 90

#include<stdio.h>
#include<math.h>
main()
{
	int a,b;
	scanf("%d,%d",&a,&b);
	
	int x,y,z;
	for(x=a,x<b,x++);
	{
		for(y=a,y<b,y++);
		{
			for(z=a,z<b,z++);
			{
				while (x*x+y*y==z*z)
				{
					printf("%d^2+%d^2=%d^2\n"x,y,z);
				}
			}
		}
	}
	return 0;
}
/*
Main.cc:3:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
Main.cc: In function 'int main()':
Main.cc:9:11: warning: right operand of comma operator has no effect [-Wunused-value]
  for(x=a,x<b,x++);
           ^
Main.cc:9:17: error: expected ';' before ')' token
  for(x=a,x<b,x++);
                 ^
Main.cc:10:2: error: expected primary-expression before '{' token
  {
  ^
Main.cc:10:2: error: expected ';' before '{' token
Main.cc:10:2: error: expected primary-expression before '{' token
Main.cc:10:2: error: expected ')' before '{' token
Main.cc:11:12: warning: right operand of comma operator has no effect [-Wunused-value]
   for(y=a,y<b,y++);
            ^
Main.cc:11:18: error: expected ';' before ')' token
   for(y=a,y<b,y++);
                  ^
Main.cc:12:3: error: expected primary-expression before '{' token
   {
   ^
Main.cc:12:3: error: expected ';' before '{' token
Main.cc:12:3: error: expected primary-expression before '{' token
Main.cc:12:3: error: expected ')' before '{' token
Main.cc:13:13: warning: right operand of comma operator has no effect [-Wunused-value]
    for(z=a,z<b,z++);
             ^
Main.cc:13:19: error: expected ';' before ')' token
    for(z=a,z<b,z++);
                   ^
Main.cc:14:4: error: expected primary-expression before '{' token
    {
    ^
Main.cc:14:4: error: expected ';' before '{' token
Main.cc:14:4: error: expected primary-expression before '{' token
Main.cc:14:4: error: expected ')' before '{' token
Main.cc:17:13: error: unable to find string literal operator 'operator""x'
      printf("%d^2+%d^2=%d^2\n"x,y,z);
             ^
*/

Double click to view unformatted code.


Back to problem 90