OOP HomeWork
This commit is contained in:
7
oop_hw1/oop_hw1_5/check_num.h
Normal file
7
oop_hw1/oop_hw1_5/check_num.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#ifndef testchar
|
||||
#define testchar
|
||||
|
||||
bool is_digit(char ch);
|
||||
|
||||
#endif // !testchar
|
13
oop_hw1/oop_hw1_5/main.cpp
Normal file
13
oop_hw1/oop_hw1_5/main.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <iostream>
|
||||
#include "check_num.h"
|
||||
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
char ch;
|
||||
for (int i = 0;i < 10;i++) {
|
||||
cin >> ch;
|
||||
cout << is_digit(ch)<<endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
3
oop_hw1/oop_hw1_5/testchar.cpp
Normal file
3
oop_hw1/oop_hw1_5/testchar.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
bool is_digit(char ch) {
|
||||
return ch >= '0' && ch <= '9';
|
||||
}
|
BIN
oop_hw1/oop_hw1_5/测试截图1_5.jpg
Normal file
BIN
oop_hw1/oop_hw1_5/测试截图1_5.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 193 KiB |
Reference in New Issue
Block a user