0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

c puzzle book op5.c

Posted at
op5.c
//  Y.Y.
#include<stdio.h>
#define PRINT(int) printf("int = %d\n",int)

int main()
{
	int x=1,y=1,z=1;

	x += y += z;//右から計算する 1:y = 2   2:x = 3
	PRINT( x < y ? y : x); //(x < y) これが真であればy 偽であればx


	PRINT( x < y ? x ++ : y ++);// x = 4  y = 3
	PRINT(x); PRINT(y);

	PRINT(x += x < y ? x ++ : y ++);
	PRINT(y); PRINT(x);


	x=3, y=z=4;
	PRINT( (x >= y >= x) ? 1 : 0 );
	PRINT( x >= y && y >= x); //偽だから0を返す
}

/*
int = 3
int = 2
int = 3
int = 3
int = 6
int = 4
int = 6
int = 0
int = 0
*/
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?