#include<stdio.h> char fun(char ch) { if(ch>='0'&&ch<='9') return '9'-(ch-'0'); } main() { char c1,c2; printf("\nThe result:\n"); c1='2';c2=fun(c1); printf("c1=%c c2=%c\n",c1,c2); c1='8';c2=fun(c1); printf("c1=%c c2=%c\n",c1,c2); c1='a';c2=fun(c1); printf("c1=%c c2=%c\n",c1,c2); }
原文地址:http://blog.csdn.net/u013116579/article/details/38056899