// Matritsaga qiymat kiritish
int f[2][3];
for (int i=0; i<2; i++) {
for (int j=0; j<3; j++) {
cin>>f[i][j];
}
}
// Matritsani chiqarish
for (int i=0; i<2; i++) {
for (int j=0; j<3; j++) {
cout<<f[i][j]<<" ";
}
cout<<endl;
}
int f[2][3];
for (int i=0; i<2; i++) {
for (int j=0; j<3; j++) {
cin>>f[i][j];
}
}
// Matritsani chiqarish
for (int i=0; i<2; i++) {
for (int j=0; j<3; j++) {
cout<<f[i][j]<<" ";
}
cout<<endl;
}
☃1
Computer Programming
Photo
// mus 1.a
int n; cin>>n;
int a[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i == j) a[i][j] = 1;
else a[i][j] = 0;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
int n; cin>>n;
int a[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i == j) a[i][j] = 1;
else a[i][j] = 0;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
❤1
Computer Programming
Photo
int n; cin>>n;
int a[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i + j == n - 1) a[i][j] = i+1;
else a[i][j] = 0;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
int a[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i + j == n - 1) a[i][j] = i+1;
else a[i][j] = 0;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
// problem 17
int n; cout<<"Enter the size: "; cin>>n;
vector<int> a(n);
vector<int> b(n+1);
for (int i = 0; i < n; i++) cin>>a[i];
cout<<endl;
int x; cout<<"Value: "; cin>>x;
int k; cout<<"Index: "; cin>>k;
for (int i = 0; i <= n; i++) {
if (i<k) b[i]=a[i];
else if (i==k) b[i]=x;
else b[i] = a[i-1];
cout<<b[i]<<" ";
}
int n; cout<<"Enter the size: "; cin>>n;
vector<int> a(n);
vector<int> b(n+1);
for (int i = 0; i < n; i++) cin>>a[i];
cout<<endl;
int x; cout<<"Value: "; cin>>x;
int k; cout<<"Index: "; cin>>k;
for (int i = 0; i <= n; i++) {
if (i<k) b[i]=a[i];
else if (i==k) b[i]=x;
else b[i] = a[i-1];
cout<<b[i]<<" ";
}
Qaysi masalani ishlab berishimizni xohlaysiz?
Kommentda yozib qoldiring👇
Kommentda yozib qoldiring👇
Forwarded from Computer Programming (Asadbek Toʻlqinjonov)
Qaysi masalani ishlab berishimizni xohlaysiz?
Kommentda yozib qoldiring👇
Kommentda yozib qoldiring👇
C++ tilidan darslar va quizlar uchun linklar👇🏻:
1. C++ tilidan darslar va quizlar uchun linklar👇🏻:
1. W3Schools C++ Quiz
2. CodeVisionZ
3. CodeChef C++ Skill Test
@cpp_sirius🧑🏻💻
1. C++ tilidan darslar va quizlar uchun linklar👇🏻:
1. W3Schools C++ Quiz
2. CodeVisionZ
3. CodeChef C++ Skill Test
@cpp_sirius🧑🏻💻
W3Schools
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
❤2