请给我解决方案以获得“和” _price" [英] PLEASE GIVE ME SOLUTION to GET SUM of " _price "

查看:72
本文介绍了请给我解决方案以获得“和” _price"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请给我解决方案以获得_price





for(int i = 0; i< countrows; i ++)

{

BluetoothPrintDriver.LF();

BluetoothPrintDriver.Excute();

BluetoothPrintDriver.ImportData(_price [i]);

BluetoothPrintDriver.LF();

BluetoothPrintDriver.Excute();

BluetoothPrintDriver.ClearData();

}



我尝试过:



for(int i = 0; i< countrows; i ++)

{

BluetoothPrintDriver.LF();

BluetoothPrintDriver.Excute() ;

BluetoothPrintDriver.ImportData(_price [i]);

BluetoothPrintDriver.LF();

BluetoothPrintDr iver.Excute();

BluetoothPrintDriver.ClearData();

}

PLEASE GIVE ME SOLUTION TO GET SUM OF _price


for (int i = 0; i < countrows; i++)
{
BluetoothPrintDriver.LF();
BluetoothPrintDriver.Excute();
BluetoothPrintDriver.ImportData(_price[i]);
BluetoothPrintDriver.LF();
BluetoothPrintDriver.Excute();
BluetoothPrintDriver.ClearData();
}

What I have tried:

for (int i = 0; i < countrows; i++)
{
BluetoothPrintDriver.LF();
BluetoothPrintDriver.Excute();
BluetoothPrintDriver.ImportData(_price[i]);
BluetoothPrintDriver.LF();
BluetoothPrintDriver.Excute();
BluetoothPrintDriver.ClearData();
}

推荐答案

我们不是代码订购服务:我们不为您工作,也不做功课。



但总结一个数组是微不足道的:

We aren't a "code to order" service: we do not do your work for you, nor do we do your homework.

But summing an array is trivial:
var sum = _price.Sum();

Enumerable.Sum方法 [ ^ ]


这篇关于请给我解决方案以获得“和” _price&quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆