/*
#include <stdio.h>
typedef struct
{
char name[11];
int score;
}st;
int main()
{
st com[101]={};
int i,j,n,m;
int count=0,scorre=0;
scanf("%d %d ",&n,&m);
for(i=0;i<n;i++)
scanf("%s %d",com[i].name,&com[i].score);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
if(com[j].score>scorre){
scorre=com[j].score;
count=j;
}
}
// printf("%d\n",scorre);
printf("%s\n",com[count].name);
com[count].score=-200000000;
scorre=0;
}
return 0;
#include <stdio.h>
int main()
{
int a=10;
int* pa = &a;
printf("a : %d\n",a);
printf("&a : %d\n",&a);
printf("pa : %d\n",pa);
printf("*pa : %d\n",*pa);
}
#include <stdio.h>
void f(int* pa)
{
*pa = 100;
}
int main()
{
int a=10;
f(&a);
printf("%d",a);
}
#include <stdio.h>
void myswap(int* p1,int* p2)
{
if(*p1>*p2)
{
int sec_a;
sec_a=*p1;
*p1=*p2;
*p2=sec_a;
}
}
main()
{
int a, b;
scanf("%d%d", &a, &b);
myswap(&a, &b);
printf("%d %d", a, b);
}
#include <stdio.h>
void f(char* str)
{
//printf("%s",str);
str[0]='c';
str[2]='c';
}
int main()
{
char str[50]={};
//배열의 이름 == 배열의첫번째원소의 주소
scanf("%s",str); //str = &str[0]
f(str);
printf("%s",str);
}
for(int i=start;i<start+count;i++)
{
printf("%c",str[i]);
}
*/
/*
#include <stdio.h>
char* mysubstr(char *str,int start,int count)
{
//대충 그 범위 안이 아니라 면 NULL롤 바꾼후 라턴하면 된다 에카하냐 그걸 으으으으으으음 으으음 으으으음 음 포문을 돌린후 i와 j를 동시에 값을 일씩 올리고 만약 j가 아이가 아님라면 NULL로 볌홤함다 아 캐리여 gc(good code)
str[start+count]=NULL;
return &str[start];
}
int main()
{
int start,count;
char str[101];
scanf("%s %d %d",str,&start,&count);
printf("%s",mysubstr(str,start,count));
}
*/