#include<stdio.h>#include<string.h>#include<math.h>intmain(){int a[3][3], b[3][3], c[3][3];int i, j, k, n, m, x, y;for(x =0; x <3; x++){for(y =0; y <3; y++)scanf("%d",&a[x][y]);}for(x =0; x <3; x++){for(y =0; y <3; y++)scanf("%d",&b[x][y]);}for(i =0; i <3; i++)for(j =0; j <3; j++)
c[i][j]=0;for(i =0; i <3; i++){for(j =0; j <3; j++){for(k =0; k <3; k++)//第三个k
c[i][j]+= a[i][k]* b[k][j];//核心代码写法}}for(m =0; m <3; m++){for(n =0; n <3; n++)printf("%d ", c[m][n]);printf("\n");}}
#include<stdio.h>#include<string.h>#include<math.h>intmain(){int n,i,j,a,b;char x[101][50],y[50];while(scanf("%d",&n)!=EOF){for(i =0; i < n; i++){scanf("%s",&x[i]);}for(j=0;j<n;j++)for(a =0; a < n -1; a++)//必须到n-1就停止{if(strcmp(x[a], x[a +1])>0)//strcmp(s1,s2) 判断两个字符串s1和s2是否相同{//若str1<str2,则返回负数;//若str1 > str2,则返回正数。strcpy(y ,x[a]);//y只是传值排序strcpy(x[a], x[a +1]);strcpy(x[a +1], y);}}for(b =0; b < n; b++)printf("%s\n", x[b]);return0;}}
#include<stdio.h>#include<string.h>#include<math.h>intmain(){int m, k, i,j,c=0,n;int flag =0;while(scanf("%d %d",&m,&k)!=EOF){
flag =0;for(i = m+1; i > m; i++){if(flag ==1)break;
n =sqrt(i);for(j=2;j<=n;j++){if(i%j ==0)break;if(j >= n){
c++;if(c < k)printf("%d ", i);if(c == k)printf("%d\n", i);if(c > k)
flag =1;}}}}return0;}
#include<stdio.h>#include<string.h>#include<math.h>intmain(){char a[37];int n,i,j,k,s;//错在写太复杂了 其实很简单scanf("%s",&a);
s =strlen(a);scanf("%d",&n);for(j = s - n; j < s; j++)printf("%c", a[j]);for(j =0; j < s - n; j++)printf("%c", a[j]);printf("\n");return0;}
#include<stdio.h>#include<string.h>#include<math.h>voidsort(char a[][1000],int n,char b[][1000]){int i, j;char str[1000];for(i =0; i < n-1; i++){for(j =0; j < n -1; j++){if(strcmp(a[j], a[j +1])>0){strcpy(str, a[j]);strcpy(a[j], a[j +1]);strcpy(a[j +1], str);}}}for(i =0; i < n; i++){strcpy(b[i], a[i]);}}voidlen_sort(char a[][1000],int n){int i, j, len1, len2;char str[1000];for(i =0; i < n -1; i++){for(j =0; j < n -1; j++){if((len1 =strlen(a[j]))>(len2 =strlen(a[j +1]))){strcpy(str, a[j]);strcpy(a[j], a[j +1]);strcpy(a[j +1], str);}}}for(i =0; i < n; i++){if(i ==0)printf("%s", a[i]);elseprintf(" %s", a[i]);}printf("\n");}intmain(){char a[100][1000], b[100][1000];int n, i;scanf("%d",&n);for(i =0; i < n; i++)scanf("%s", a[i]);sort(a, n, b);len_sort(a, n);for(i =0; i < n; i++){if(i ==0)printf("%s", b[i]);elseprintf(" %s", b[i]);}printf("\n");return0;}
intmain(){int n,i,j;scanf("%d",&n);for(i =1; i <= n; i++){printf("%d", i);for(j =0; j < n -1; j++)printf(" %d",(i + j)% n +1);//核心代码建议看f10printf("\n");}}
#include<stdio.h>#include<string.h>#include<math.h>int main(){ int a[3][3], b[3][3], c[3][3]; int i, j, k, n, m, x, y; for (x = 0; x < 3; x++) { for (y = 0; y < 3...