標(biāo)題: C語言變量的差值怎么寫? [打印本頁]

作者: 喵咪zzz    時(shí)間: 2022-5-2 15:59
標(biāo)題: C語言變量的差值怎么寫?
循環(huán)一次得出:temp = 2;
循環(huán)二次得出:  temp =4;
用語句怎么表示出同一個(gè)變量在這兩次循環(huán)后的差值呢??
change  = ????

作者: IdeaMing    時(shí)間: 2022-5-2 16:59
char old;
char temp;
char change;

change = temp-old;
old = temp;

作者: 2766470543    時(shí)間: 2022-5-2 21:52
#include <stdlib.h>
int main(int argc, char *argv[])
{ int a,b; printf("請輸入a和b兩個(gè)數(shù),并采用,分隔:"); scanf("%d,%d",&a,&b);
printf("a+b=%d",a+b); return 0; }




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1