Skip to main content
deleted 160 characters in body
Source Link
Aryaman
  • 161
  • 3

C, 252 220 225225 111 bytes

#include<stdio.h>
#include<string.h>
int main(){char a[128]; int r=0;scanf("%s",a);for (int i = 0;i < strlen(a);i++){r += ((int)a[i]);for (int j = 0; j < strlen(a); j++) r *= r;}if (r == (int) a) printf("1\n");else printf("0\n");}
int f(char *a){for(int i=0;i<strlen(a);i++){r+=((int)a[i]);for(int j=0;j<strlen(a);j++)r*=r;}return r==(int)a;}

Returns 0 if false and 1 if true. The maximum number of digits for the inputted number is 128. Thanks to @DrMcMoylex for saving 27many bytes and explaining stuff.

C, 252 220 225 bytes

#include<stdio.h>
#include<string.h>
int main(){char a[128]; int r=0;scanf("%s",a);for (int i = 0;i < strlen(a);i++){r += ((int)a[i]);for (int j = 0; j < strlen(a); j++) r *= r;}if (r == (int) a) printf("1\n");else printf("0\n");}

Returns 0 if false and 1 if true. The maximum number of digits for the inputted number is 128. Thanks to @DrMcMoylex for saving 27 bytes.

C, 252 220 225 111 bytes

int f(char *a){for(int i=0;i<strlen(a);i++){r+=((int)a[i]);for(int j=0;j<strlen(a);j++)r*=r;}return r==(int)a;}

Returns 0 if false and 1 if true. Thanks to @DrMcMoylex for saving many bytes and explaining stuff.

you can actually see the output!
Source Link
Aryaman
  • 161
  • 3

C, 252 220220 225 bytes

#include<stdio.h>
#include<string.h>
int main(){char a[128]; int r=0;scanf("%s",a);for (int i = 0;i < strlen(a);i++){r += ((int)a[i]);for (int j = 0; j < strlen(a); j++) r *= r;}if (r == (int) a) return 1;else returnprintf("1\n");else 0;printf("0\n");}

Returns 0 if false and 1 if true. The maximum number of digits for the inputted number is 128. Thanks to @DrMcMoylex for saving 3227 bytes.

C, 252 220 bytes

#include<stdio.h>
#include<string.h>
int main(){char a[128]; int r=0;scanf("%s",a);for (int i = 0;i < strlen(a);i++){r += ((int)a[i]);for (int j = 0; j < strlen(a); j++) r *= r;}if (r == (int) a) return 1;else return 0;}

Returns 0 if false and 1 if true. The maximum number of digits for the inputted number is 128. Thanks to @DrMcMoylex for saving 32 bytes.

C, 252 220 225 bytes

#include<stdio.h>
#include<string.h>
int main(){char a[128]; int r=0;scanf("%s",a);for (int i = 0;i < strlen(a);i++){r += ((int)a[i]);for (int j = 0; j < strlen(a); j++) r *= r;}if (r == (int) a) printf("1\n");else printf("0\n");}

Returns 0 if false and 1 if true. The maximum number of digits for the inputted number is 128. Thanks to @DrMcMoylex for saving 27 bytes.

deleted 43 characters in body
Source Link
Aryaman
  • 161
  • 3

C, 252252 220 bytes

#include<stdio.h>
#include<string.h>
int main()
 {
 char a[128];
  int r=0;
scanfr=0;scanf("%s",a);
for;for (int i = 0;i < strlen(a);i++){
 r += ((int)a[i]);
for;for (int j = 0; j < strlen(a); j++)
    r *= r;
 }
 if (r == (int) a)
    printf("1\n");
else
 return 1;else return printf("0");
0;}

PrintsReturns 0 if false and 1 if true. The maximum number of digits for the inputted number is 128. Thanks to @DrMcMoylex for saving 32 bytes.

C, 252 bytes

#include<stdio.h>
#include<string.h>
int main()
 {
 char a[128];
 int r=0;
scanf("%s",a);
for (int i = 0;i < strlen(a);i++){
 r += ((int)a[i]);
for (int j = 0; j < strlen(a); j++)
    r *= r;
 }
 if (r == (int) a)
    printf("1\n");
else
    printf("0");
}

Prints 0 if false and 1 if true. The maximum number of digits for the inputted number is 128.

C, 252 220 bytes

#include<stdio.h>
#include<string.h>
int main(){char a[128]; int r=0;scanf("%s",a);for (int i = 0;i < strlen(a);i++){r += ((int)a[i]);for (int j = 0; j < strlen(a); j++) r *= r;}if (r == (int) a) return 1;else return 0;}

Returns 0 if false and 1 if true. The maximum number of digits for the inputted number is 128. Thanks to @DrMcMoylex for saving 32 bytes.

added 61 characters in body
Source Link
Aryaman
  • 161
  • 3
Loading
Source Link
Aryaman
  • 161
  • 3
Loading