当前位置:网站首页>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;
}
边栏推荐
- Time standard library
- Jerry's configuration of TWS cross pairing [article]
- Google SEO external chain backlinks research tool recommendation
- What is the reason for the abnormal flow consumption of 4G devices accessing the easygbs platform?
- Navicat connect 2002 - can't connect to local MySQL server through socket '/var/lib/mysql/mysql Sock 'solve
- Pre sale 179000, hengchi 5 can fire? Product power online depends on how it is sold
- Demon daddy B3 read extensively in a small amount, and completed 20000 vocabulary+
- Dry goods sharing | devaxpress v22.1 original help document download collection
- 反爬通杀神器
- Use camunda to do workflow design and reject operations
猜你喜欢

PDF文档签名指南

Debugging and handling the problem of jamming for about 30s during SSH login

嵌入式开发:如何为项目选择合适的RTOS?

你可曾迷茫?曾经的测试/开发程序员,懵懂的小菜C鸟升级......

Dry goods sharing | devaxpress v22.1 original help document download collection

Ad domain group policy management

NVR hard disk video recorder is connected to easycvr through the national standard gb28181 protocol. What is the reason why the device channel information is not displayed?

Matplotlib drawing interface settings

强化学习-学习笔记9 | Multi-Step-TD-Target
![Jerry's about TWS channel configuration [chapter]](/img/94/fde5054fc412b786cd9864215e912c.png)
Jerry's about TWS channel configuration [chapter]
随机推荐
How polardb-x does distributed database hotspot analysis
Demon daddy C
[advanced MySQL] index details (I): index data page structure
Arlo's troubles
Jerry's manual matching method [chapter]
SAR影像质量评估
Why can't win11 display seconds? How to solve the problem that win11 time does not display seconds?
Code of "digital image processing principle and Practice (matlab version)" part2[easy to understand]
Actual combat: sqlserver 2008 Extended event XML is converted to standard table format [easy to understand]
What is the reason for the abnormal flow consumption of 4G devices accessing the easygbs platform?
Win11如何解禁键盘?Win11解禁键盘的方法
Pre sale 179000, hengchi 5 can fire? Product power online depends on how it is sold
Use br to recover backup data on azure blob storage
Devil daddy B1 hearing the last barrier, break through with all his strength
PDF文档签名指南
#DAYU200体验官#MPPT光伏发电项目 DAYU200、Hi3861、华为云IotDA
Jenkins user rights management
强化学习-学习笔记9 | Multi-Step-TD-Target
DBSync新增对MongoDB、ES的支持
What if the win11u disk does not display? Solution to failure of win11 plug-in USB flash disk