Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <ctype.h>
- #include <stdbool.h>
- bool CzyCyfry(const char *p) {
- int i=0;
- while(p[i]) {
- if (!isdigit(p[i])) {
- return false;
- }
- ++i;
- }
- return true;
- }
- int main() {
- char tekst[81];
- while(gets(tekst)!=NULL && tekst[0]!='\n') {
- if (CzyCyfry(tekst)==false) {
- puts("Nie wszystkie znaki sa cyframi.");
- }
- else {
- puts("Sa same cyfry.");
- }
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement