-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprintf.cpp
More file actions
47 lines (38 loc) · 838 Bytes
/
Copy pathprintf.cpp
File metadata and controls
47 lines (38 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
#include <windows.h>
#include <string>
using namespace std;
string str;
char cha[10];
int main(){
scanf("%s", &str);
printf("%s\n", str);
scanf("%s", &cha);
printf("%s\n", cha);
string str2 = "hello";
char hello[10] = "hello";
// if(cha == str){
// printf("same string!\n");
// }else{
// printf("different string!\n");
// }//실행안됨
if(cha == str2){
printf("same string!\n");
}else{
printf("different string!\n");
}//제대로나옴
if(cha == hello){
printf("same string!\n");
}else{
printf("different string!\n");
}//잘못나옴
str2 = hello;
if(cha == hello){
printf("same string!\n");
}else{
printf("different string!\n");
}//잘못나옴
int N;
scanf("%d", &N);
//종료방지
}