<commit_before>/* GNU gcc compiler on windows 10 x64 platform
mingw32  gcc version 4.9.2
 -std=c11					*/

#include "stdio.h"
#include "stdlib.h"
#include "math.h"

void reverse(char *array, int n)
{
    char temp[260];

    int i = 0;
    for (i = 0; i <= n; i++)
    {
        temp[i] = array[n - i - 1];
    }
    temp[i] = '\0';

    for (i = 0; i < n; i++)
    {
        array[i] = temp[i];
    }
    array[i] = '\0';
}

int main()
{
    char s1[260] = "12345";
    char s2[260] = "11232345";
    // scanf("%s", s1);
    // scanf("%s", s2);

    int i = 0;
    int n_s1 = 0;
    while (s1[i++] != '\0')
        n_s1++;

    i = 0;
    int n_s2 = 0;
    while (s2[i++] != '\0')
        n_s2++;

    reverse(s1, n_s1);
    reverse(s2, n_s2);
    printf("s1: %s\n", s1);
    printf("s2: %s\n", s2);




    getchar();
    return 0;
}<commit_msg>hw5 完成<commit_after>/* GNU gcc compiler on windows 10 x64 platform
mingw32  g++ version 4.9.2
 -std=c++11					*/

#include "stdio.h"
#include "stdlib.h"
#include "math.h"

void reverse(char *array, int n)
{
    char temp[260];

    int i = 0;
    for (i = 0; i <= n; i++)
    {
        temp[i] = array[n - i - 1];
    }
    temp[i] = '\0';

    for (i = 0; i < n; i++)
    {
        array[i] = temp[i];
    }
    array[i] = '\0';
}

int main()
{
    char s1[260];
    char s2[260];

    printf(" first integer? ");
    scanf("%s", s1);
    printf("second integer? ");
    scanf("%s", s2);


    int i = 0;
    int n_s1 = 0;
    while (s1[i++] != '\0')
        n_s1++;

    i = 0;
    int n_s2 = 0;
    while (s2[i++] != '\0')
        n_s2++;

    reverse(s1, n_s1);
    reverse(s2, n_s2);

    for (i = n_s1; i < 260; i++)
        s1[i] = '0';
    for (i = n_s2; i < 260; i++)
        s2[i] = '0';

    int sum[260];
    for (i = 0; i < 260; i++)
    {
        sum[i] = s1[i] + s2[i] - '0' - '0';
    }

    for (i = 0; i < 260; i++)
    {
        if (sum[i] >= 10)
        {
            sum[i] -= 10;
            sum[i + 1] += 1;
        }
    }


    int j;
    for (j = 0; j < 260; j++)
    {
        if (sum[260 - j] != 0)
            break;
    }
    j = 260 - j + 1;


    char result[260];

    for (i = 0; i < j; i++)
    {
        result[i] = sum[i] + '0';
    }
    result[i] = '\0';
    reverse(result, i);
    printf("Their sum is: %s", result);

    getchar();
    getchar();
    return 0;
}
{'fraction_non_alphanumeric': 0.2152275627392599, 'fraction_numerical': 0.06933219906422798, 'mean_word_length': 1.5817782656421515, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2456431', 'n_tokens_mistral': 1151, 'n_tokens_neox': 1023, 'n_words': 271}