post_pre.c
This commit is contained in:
parent
bd04092af5
commit
e436681710
15
c05_expression/post_pre.c
Normal file
15
c05_expression/post_pre.c
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/* post_pre.c - 前缀和后缀 */
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
int a = 1, b = 1;
|
||||||
|
int a_post, pre_b;
|
||||||
|
|
||||||
|
a_post = a++;
|
||||||
|
pre_b = ++b;
|
||||||
|
printf("a\ta_post\tb\tpre_b\n");
|
||||||
|
printf("%d\t%d\t%d\t%d\n", a, a_post, b, pre_b);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user