Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
Quiz-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
정용석
Quiz-1
Commits
60afe2f2
Commit
60afe2f2
authored
Jan 17, 2025
by
정용석
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.cpp 추가
parent
bdc17b34
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
quine.cpp
+4
-0
quiz6.cpp
+42
-0
No files found.
quine.cpp
0 → 100644
View file @
60afe2f2
#include <stdio.h>
char
S
[]
=
"#include <stdio.h>%cchar S[] = %c%s%c;%cint main() { printf(S, 10, 34, S, 34, 10); return 0; }"
;
int
main
()
{
printf
(
S
,
10
,
34
,
S
,
34
,
10
);
return
0
;
}
\ No newline at end of file
quiz6.cpp
0 → 100644
View file @
60afe2f2
#include <stdio.h>
#include <stdlib.h>
unsigned
int
my_strlen
(
char
*
s
){
unsigned
int
i
=
0
;
while
(
s
[
i
]
!=
'\0'
){
i
++
;
}
return
i
;
}
void
my_strcpy
(
char
*
s1
,
char
*
s2
)
{
char
copyS2
[
my_strlen
(
s2
)
+
1
];
int
i
=
0
;
while
(
s2
[
i
]
!=
'\0'
){
copyS2
[
i
]
=
s2
[
i
];
i
++
;
}
if
(
my_strlen
(
s1
)
<=
my_strlen
(
s2
)){
printf
(
"Error : 첫 번째 인자의 배열의 크기가 두 번째 인자의 크기보다 작기 때문에 정상적인 복사가 되지않습니다.
\n
"
);
}
else
{
while
(
*
s1
++
=
*
s2
++
);
}
}
int
main
()
{
char
s1
[]
=
"abcd"
;
char
s2
[]
=
"efghijk"
;
my_strcpy
(
s1
,
s2
);
printf
(
"%s
\n
%s
\n
"
,
s1
,
s2
);
char
s3
[]
=
"abcdefg"
;
char
s4
[]
=
"hijk"
;
my_strcpy
(
s3
,
s4
);
printf
(
"%s
\n
%s
\n
"
,
s3
,
s4
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment