可以用什么来存储多个整形变量的表达式?求解
c4droid吧
全部回复
仅看楼主
level 11
2017年11月24日 00点11分 1
level 11
急求[乖][乖][乖]
2017年11月24日 00点11分 2
level 9
数组?
2017年11月24日 02点11分 3
数组能存?
2017年11月24日 02点11分
变量未知
2017年11月24日 02点11分
回复 可乐可乐🌿 :表达式?什么样的?
2017年11月24日 02点11分
@YYYYXoxoxo 比如x+1,y*2,z*2+3等等x,y,z都是自己输入的一个变量,怎么把这些存在一起,要用到的时候再输出它们的值
2017年11月24日 02点11分
level 9
这样存?
#include<stdio.h>
#include<string.h>
char a(char s);
int main(){
char s[][50]={"","","",""};
char a[]="x*2";
strcpy(s[0],a);
char b[]="x+2";
strcpy(s[1],b);
char c[]="x-2";
strcpy(s[2],c);
char d[]="x/2";
strcpy(s[3],d);
for (int i=0;i<4;i++)
printf("%s\n",s[i]);
}
2017年11月24日 03点11分 4
还差输出表达式的值
2017年11月24日 03点11分
回复 可乐可乐🌿 :这个我就。。。。。。
2017年11月24日 03点11分
1