#include<stdio.h>
#define M 2
#define N 3
void scanfjuzhen(int arr[M][N])//向二维数组输入数据
{
int i = 0;
int j = 0;
for (i = 0; i < M; i++)
{
for (j = 0; j < N; j++)
scanf("%d", &arr[i][j]);
}
}
void sumjuzhen(int a[M][N], int b[M][N],int c[M][N])//计算A与B的和并存与C中
{
int i =0 ;
int j = 0;
int sum = 0;
for (i = 0; i < M; i++)
{
for (j = 0; j < N; j++)
{
c[i][j] = a[i][j] + b[i][j];
}
}
}
int main()
{
int a[M][N];
int b[M][N];
int c[M][N];
int i = 0;
int j = 0;
printf("输入a矩阵元素的值:");
scanfjuzhen(a); //调用scanfjuzhen()函数,向二维数组A中输入数据
printf("输入b矩阵元素的值:");
scanfjuzhen(b); //调用scanfjuzhen()函数,向二维数组B中输入数据
sumjuzhen(a, b,c);//计算A与B的和并存与C中
printf("A与B的和的矩阵C为:\n");
for (i = 0; i < M; i++)
{
for (j = 0; j < N; j++)
{
printf("%d ", c[i][j]);
}
printf("\n");
}
return 0;
}
原博客地址:Alpaca: A Strong, Replicable Instruction-Following Model github地址:https://github.com/tatsu-lab/stanford_alpaca Alpaca简介
Alpaca是斯坦福大学在Meta开源的大模型LLaMA 7B基础上使用自构建的52K指令数据重新训练得到的增强模型&am…