c language compiler problem Microsoft Visual C ++

 

 The question arises bigwigs hope can help solve. Ha ha ha

First of all this is to write the next project I created in Microsoft Visual C ++ in the third program.

Compile and run this program before and have no problems.

but. . . . . . .

#include <stdio.h>
#include <stdlib.h>
void main3  ()
{
	int x,y,z,n,max;
	printf ("输入x,y,z,n四个数:");
    scanf ("%d%d%d%d",&x,&y,&z,&n);
	if (x>y)
		if(x>z)
			if(x>n)
				max=x;
			else
				max=n;
		else
		    if(z>n)
				max=z;
			else
				max=n;
	else
		if (y>z)
			if (y>n)
				max=y;
			else 
				max=n;
		else
			if (z>n)
				max=z;
			else
				max=n;
    printf ("\n输出最大值:%d\n\n",max);
	system ("pause");
}

  After I wrote two programs.

#include <stdio.h>
#include <stdlib.h>
void main4()
{
    int x;
    float y,j;
    printf ("购买商品数:");
    scanf ("%d",&x);
    printf ("商品单价:");
    scanf ("%f",&y);
    if (x<5)
        printf ("%f",j=y*x);
    else   if (5<=x<10)
        printf ("%f",j=x*y*0.99);
         else  if (10<=x<20)
              printf ("%f",j=x*y*0.98);
              else  if (20<=x<30)
                  printf ("%f",j=x*y*0.95);
                   else    (x>=30)
                    printf ("%f",j=x*y*0.9);

    system ("pause");
}
#include <stdio.h>
#include <stdlib.h>
void main ()
{
    int h,a=1,b=2,c=3;
    h=a+b*c;
    printf ("%d",h);
    system ("pause");
}

 

Then when I run fourth result has been running the program is the third program.

I was very puzzled. . . .

Then I come to their senses to write a new program.

The above is the third program. Then the results. . . . . . . Very angry.

Then big brother to help me to find it.

Then he said this is the first you compile and run to get the results you want.

Then I wonder. Debugging compiler Micrsolosft Visual C ++ is not running train Well  

Looking for a long or did not find again what the compiler. Which was later found on the Internet and then compile the results still not been resolved.

You can only find big brothers to help in this matter.

 

Guess you like

Origin www.cnblogs.com/ahsngssjzx/p/11781094.html