20250605 baekjoon C
This commit is contained in:
parent
0913637881
commit
2ef38a21d2
28
code_study/Baekjoon/c/10798.c
Normal file
28
code_study/Baekjoon/c/10798.c
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
char arr[5][16];
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int max_len=0, len;
|
||||||
|
|
||||||
|
for(int i=0; i<5; i++){
|
||||||
|
scanf("%s",arr[i]);
|
||||||
|
len=0;
|
||||||
|
for(int j=0; arr[i][j]!='\0'; j++){
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
if(max_len<len){
|
||||||
|
max_len=len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int j=0; j<max_len; j++){
|
||||||
|
for(int i=0; i<5; i++){
|
||||||
|
if(arr[i][j] != '\0'){
|
||||||
|
printf("%c",arr[i][j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
24
code_study/Baekjoon/c/2563.c
Normal file
24
code_study/Baekjoon/c/2563.c
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int paper[100][100]={0,};
|
||||||
|
int n, x, y, sum=0;
|
||||||
|
|
||||||
|
scanf("%d",&n);
|
||||||
|
|
||||||
|
while(n--){
|
||||||
|
scanf("%d %d",&x, &y);
|
||||||
|
for(int i=x-1; i<x+9; i++){
|
||||||
|
for(int j=y-1; j<y+9; j++){
|
||||||
|
if(paper[i][j]!=1){
|
||||||
|
sum++;
|
||||||
|
paper[i][j]=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%d",sum);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
21
code_study/Baekjoon/c/2566.c
Normal file
21
code_study/Baekjoon/c/2566.c
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int arr[9][9];
|
||||||
|
int max_value=0, max_i=1, max_j=1;
|
||||||
|
|
||||||
|
for(int i=0; i<9; i++){
|
||||||
|
for(int j=0; j<9; j++){
|
||||||
|
scanf("%d",&arr[i][j]);
|
||||||
|
if(max_value<arr[i][j]){
|
||||||
|
max_value = arr[i][j];
|
||||||
|
max_i = i+1;
|
||||||
|
max_j = j+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%d\n%d %d",max_value,max_i,max_j);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
30
code_study/Baekjoon/c/2738.c
Normal file
30
code_study/Baekjoon/c/2738.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int a[100][100];
|
||||||
|
int n,m,x;
|
||||||
|
|
||||||
|
scanf("%d %d",&n,&m);
|
||||||
|
|
||||||
|
for(int i=0; i<n; i++){
|
||||||
|
for(int j=0; j<m; j++){
|
||||||
|
scanf("%d",&a[i][j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0; i<n; i++){
|
||||||
|
for(int j=0; j<m; j++){
|
||||||
|
scanf("%d",&x);
|
||||||
|
a[i][j] += x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0; i<n; i++){
|
||||||
|
for(int j=0; j<m; j++){
|
||||||
|
printf("%d ",a[i][j]);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user