목록전체 글 (75)
괴발개발 개발하다
1. 코드 #include char* change(char* str, char ori, char new); int main(){ char str[50] = "Hello world"; char ori, new; printf("문자열 입력: "); gets(str); printf("변경할 기존 문자와 대체할 새로운 문자 입력: "); scanf("%c %c", &ori, &new); change(str, ori, new); printf("결과: %s\n", str); return 0; } char* change(char* str, char ori, char new){ int i; for(i=0; str[i]!= NULL; i++){ if(str[i] == ori){ str[i]=new; } } return ..
1. 구상 2. 코드 #include #define MAIN_01 3500 #define MAIN_02 4000 #define SIDE_01 1500 #define SIDE_02 2000 #define SIDE_03 3000 void sowMenu(); void pay(int i); int main(){ int mainChoice; int topingWant; int topingChoice; int money; int payWant; int answer = 1; while(answer){ int sum = 0; //반복시작 showMenu(); scanf("%d", &mainChoice); if(mainChoice == 1){ printf("팥빙수를 고르셨습니다."); sum += MAIN_01; }el..
package practice_Alone; import java.util.ArrayList; import java.util.Scanner; public class FirstReview { //public static void printHello() { //System.out.println("Hello Hello~!!!! 하하하"); public static void main(String[] args) { //printHello(); //Scanner sc = new Scanner(System.in); //String name = sc.next(); //int num = sc.nextInt(); //System.out.println(name + "와" + num); //Student s2 = new Stu..