当前位置:网站首页>How to write an augmented matrix into TXT file
How to write an augmented matrix into TXT file
2022-07-07 22:06:00 【51CTO】
Write a 398 That's ok ,399 Columns of the matrix
#include<iostream>
using namespace std;
int main()
{
float arr1[450];
float c=1.0;
float b=2.0;
int i=0,j=0;
FILE *fp;
for(i=0;i<400;i++)
{
arr1[i]=i;
}
fp=fopen("aaa.txt","w");
for(i=0;i<399;i++)
{
for(j=0;j<=399;j++)
{
if(j==i)
fprintf(fp,"%f%c",b,' ');
else if(j==i+1 && i!=398)
fprintf(fp,"%f%c",c,' ');
else if(j==i-1)
fprintf(fp,"%f%c",c,' ');
else if(j==399)
{
fprintf(fp,"%f%c",arr1[i],' ');
}
else
fprintf(fp,"%f%c",0.0,' ');
}
}
fclose(fp);
cout<<arr1[9]<<endl;
return 0;
}
边栏推荐
- 使用 CustomPaint 绘制基本图形
- Which financial products will yield high returns in 2022?
- Lingyun going to sea | saihe & Huawei cloud: jointly help the sustainable development of cross-border e-commerce industry
- Ant destination multiple selection
- NVR硬盤錄像機通過國標GB28181協議接入EasyCVR,設備通道信息不顯示是什麼原因?
- Overseas agent recommendation
- Index summary (assault version)
- 反爬通杀神器
- Jerry's fast pairing does not support canceling pairing [article]
- Codemail auto collation code of visual studio plug-in
猜你喜欢
Index summary (assault version)
How to quickly check whether the opening area ratio of steel mesh conforms to ipc7525
Win11如何解禁键盘?Win11解禁键盘的方法
How to make agile digital transformation strategy for manufacturing enterprises
The maximum number of meetings you can attend [greedy + priority queue]
Implementation method of data platform landing
Talk about relational database and serverless
How does win11 unblock the keyboard? Method of unlocking keyboard in win11
Demon daddy B3 read extensively in a small amount, and completed 20000 vocabulary+
Solve the problem of uni in uni app Request sent a post request without response.
随机推荐
The difference between NPM uninstall and RM direct deletion
The new version of onespin 360 DV has been released, refreshing the experience of FPGA formal verification function
海外代理推荐
[200 opencv routines] 223 Polygon fitting for feature extraction (cv.approxpolydp)
[open source] Net ORM accessing Firebird database
L2:ZK-Rollup的现状,前景和痛点
Automatic classification of defective photovoltaic module cells in electronic images
Demon daddy B2 breaks through grammar and completes orthodox oral practice
Reinforcement learning - learning notes 9 | multi step TD target
Reinforcement learning - learning notes 8 | Q-learning
Wechat official account oauth2.0 authorizes login and displays user information
Debugging and handling the problem of jamming for about 30s during SSH login
An overview of the latest research progress of "efficient deep segmentation of labels" at Shanghai Jiaotong University, which comprehensively expounds the deep segmentation methods of unsupervised, ro
【JDBC Part 1】概述、获取连接、CRUD
怎样写一个增广矩阵到txt文件中
建立自己的网站(18)
An in-depth understanding of fp/fn/precision/recall
The strongest installation of the twin tower model, Google is playing "antique" again?
Default constraint and zero fill constraint of MySQL constraint
Jerry's key to initiate pairing [chapter]