for (int t = 0; t <= 5000; t++)
{
for (int i = 0; i < 200; i++)
{
for (int j = 0; j < 50; j++)
{
T[i, j] = T[i, j] + 2*14;
。//省略代码
}
}
using (StreamWriter sw = new StreamWriter("wendu.txt"))
{
if(t % 100==0&&j ==49 && i % 50== 0)
{
sw.Write("{0}时刻温度为:{1} ",t , Math.Round(T0[i, j], 2));
sw.WriteLine();
}
sw.Close();
}
}
在t这个循环结束后文本中只显示最后t=5000时的结果,我的目的是想得到t为100的整数倍时相应的数据。请各位指点,最好有代码。
{
for (int i = 0; i < 200; i++)
{
for (int j = 0; j < 50; j++)
{
T[i, j] = T[i, j] + 2*14;
。//省略代码
}
}
using (StreamWriter sw = new StreamWriter("wendu.txt"))
{
if(t % 100==0&&j ==49 && i % 50== 0)
{
sw.Write("{0}时刻温度为:{1} ",t , Math.Round(T0[i, j], 2));
sw.WriteLine();
}
sw.Close();
}
}
在t这个循环结束后文本中只显示最后t=5000时的结果,我的目的是想得到t为100的整数倍时相应的数据。请各位指点,最好有代码。
解决方案 »
- 如何实现这个算法
- 如何根据数据库某一字段的值,将gridview行变灰色,不可以编辑。
- 指定的参数已超出有效值的范围。
- 怎样从字符数组中取出各个字符?
- 请问public string abc 和public static string abc有什么区别
- .NET WCF
- 为什么C#中的onload事件中this.hide();和this.Visible=false;怎么会是无效的呢?
- 请问能实现MDI窗体的多层次结构的界面么
- C#中,怎么做出这样的效果(在线等)送分100
- c#调用存储过程每次都需要指定参数名称,有什么 方法直接传参数吗?
- 大家在小型项目开发过程中,使用过强类型的DataSet及DataTable吗?
- 如何禁用缓存,防止页面后退
using (StreamWriter sw = File.AppendText(path))
{}
sw.frush() <-- 加上这个试试
{ for (int t = 0; t <= 5000; t++)
{
for (int i = 0; i < 200; i++)
{
for (int j = 0; j < 50; j++)
{
T[i, j] = T[i, j] + 2*14;
。//省略代码
}
}
if(t % 100==0&&j ==49 && i % 50== 0)
{
sw.Write("{0}时刻温度为:{1} ",t , Math.Round(T0[i, j], 2));
sw.WriteLine();
}
}
sw.Close();
}