Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用一个数组,我想同时从数组中调用 4 个元素,这样我就可以在等式中使用它们,任何人都知道如何。例如 int a[10]={1,2,3,4,5,6,7,8};
我要1234+15怎么办?
using C#:
1234 = 1*1000 + 2*100 + 3*10 + 4*1
double result = 0; int ex = 3; // Math.Pow(10,3) = 1000.00 for(int i = 0; i < 4 0; i++) { result += a[i] * Math.Pow(10, ex); ex--; } result += 15;