Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Filipa Hristova; 10 v klas; #29 #881

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2015-2016/V/29/03/task1.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int main()
}
while(k!=2*i-1)
{
printf("* ");
printf("*");
++k;
}
k=0;
Expand Down
3 changes: 1 addition & 2 deletions 2015-2016/V/29/03/task2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ int main(){
char rev[50];
int i=-1,j=0;

printf("Enter any string : ");
scanf("%s",str);

while(str[++i]!='\0');
Expand All @@ -14,7 +13,7 @@ int main(){

rev[j]='\0';

printf("Reverse of string is : %s",rev);
printf("%s",rev);

return 0;
}
2 changes: 1 addition & 1 deletion 2015-2016/V/29/04/task1.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int main() {
tmp /= 10;
}
if(cnt >= 2) {
printf("%d is met over %d times\n",i ,cnt);
printf("%d ",i);
}
i++;
}
Expand Down
10 changes: 4 additions & 6 deletions 2015-2016/V/29/05/task2.c
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
#include <stdio.h>
#include <string.h>

typedef enum { false, true } bool;

bool isPalindrome(const char* string) {
int isPalindrome(const char* string) {
int i = 0,beg = 0, end = strlen(string)-1;
for(; i < (strlen(string)-1)/2; i++,beg++,end--) {
if(string[beg] != string[end])
return false;
return 0;
}
return true;
return 1;
}

int main() {

char str[1000];
scanf("%s",str);
printf("%d",isPalindrome(str));
printf("%d", isPalindrome(str));
}