Problems

# Degree of symmetry

published at 5/9/15, 5:36:09 pm

Begin writeln ('hello world') 20000001 End

published at 1/8/17, 11:06:59 pm

Хороший тест 123425 Ответ : 1

published at 12/13/18, 9:07:27 am

var s:string; n, k, i:integer; c:char; begin s:=''; read (c); while c in ['0'..'9'] do begin s:=s+c; read(c); end; k:=0; n:=length(s); if n mod 2 = 1 then begin for i:=1 to (n div 2)+1 do if s[i]=s[n-i+1] then inc (k) end else begin for i:=1 to n div 2 do if s[i]=s[n-i+1] then inc (k); end; writeln (k); end.

published at 12/13/18, 9:07:44 am

var s:string; n, k, i:integer; c:char; begin s:=''; read (c); while c in ['0'..'9'] do begin s:=s+c; read(c); end; k:=0; n:=length(s); if n mod 2 = 1 then begin for i:=1 to (n div 2)+1 do if s[i]=s[n-i+1] then inc (k) end else begin for i:=1 to n div 2 do if s[i]=s[n-i+1] then inc (k); end; writeln (k); end.

published at 12/5/19, 4:04:34 pm

Program kkkk; var s:string; n, k, i:integer; c:char; begin s:=''; read (c); while c in ['0'..'9'] do begin s:=s+c; read(c); end; k:=0; n:=length(s); if n mo

published at 2/5/20, 3:18:23 pm

# include "bits/stdc++.h"

using namespace std; int main() { long long a[100],n,k,i=0; cin>>n; k=0; while(n!=0) { a[i++]=n%10; n=n/10; } n=i; for(i=0;i<n/2;i++) if(a[i]==a[n-1-i]) k++;

if(n%2==0)
cout<<k<<endl;
else
cout<<k+1<<endl;


return 0;}

published at 2/6/20, 3:01:20 pm

8768ci meselenin muzakiresinde

published at 2/24/20, 4:48:14 pm

Tehlil vaxti tek ededleri de nezere alin. Meselenin shertinde bu verilmeyib amma '1234321' neticede 4 vermelidir.

published at 1/7/21, 7:50:55 pm

c#-da belə yazdım. 100% using System; namespace ConsoleApp1 { class Program { static void Main() { string n = Console.ReadLine(); int say = 0; int len = n.Length; int orta = 0; if (len % 2 == 0) orta = len / 2; else { orta = (len - 1) / 2; say = 1; }

        for (int i = 0; i < orta; i++)
{
string sol = n.Substring(i, 1);
string sag = n.Substring(len - 1 - i, 1);
if (sol == sag)
say++;
}
Console.WriteLine(say);
}
}


}

published at 8/10/22, 12:42:35 am

# include<stdio.h>

using namespace std; int main(){ int n,i=0,k=0,a[100]; scanf("%ld", &n); while(n>0){ a[i++]=n%10; n/=10;} n=i; for(i=0; i<n/2; i++) if(a[i]==a[n-i-1]) k++; if(n%2==1) k++; printf("%d",k); }//Aliraxman, thanks for idea.

published at 1/2/23, 2:50:11 pm

Doupatato, şərt nümunəsi üçün təşəkkürlər. Mən həmin şərti nəzərə almamışdım, 70% verirdi

published at 2/8/23, 8:25:44 pm

# include <bits/stdc++.h>

using namespace std; int main() { string setir; int a=0, i, uzun, en; getline (cin, setir); uzun=setir.length(); en=uzun/2; if(uzun%2==1) a++; for(i=0; i<en; i++) if(setir[i]==setir[uzun-i-1]) a++; cout<<a;

}