Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug #44

Open
wants to merge 2 commits into
base: main
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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/ApLabGitPractice.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions 1.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>
#include <string>
#include <math.h>
#include <cmath>

using namespace std;

Expand All @@ -13,11 +13,11 @@ long long int factorial(int n)

long long int *producingTheFactorialFractions()
{
long long b[10];
b = new long long [10];

for (int i = 10; i >= 0; i--)
for (int i = 9; i >= 0; i--)
{
b[i] += (int)pow(factorial(10), 2.0) / (i + 1);
b[i] += (long long int)pow(factorial(10), 2.0) / (i + 1);
}
return b;
}
Expand All @@ -26,7 +26,7 @@ void checkZeros(long long *a)
{
for (int i = 9; i >= 0; i--)
{
if (a[i] = 0)
if (a[i] == 0)
cout << "Zero Found" << endl;
}
}
Expand All @@ -43,8 +43,8 @@ int main()
}
delete a;

cout<<"hello";
cout<<"Bye";
cout<<"hello"<<endl;
cout<<"Bye"<<endl;


}
8 changes: 4 additions & 4 deletions 2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ using namespace std;

// count all the specific char in the whole array of strings
int countAllSpecificChars(string sArr[], int arrLength, char specificChar) {
int count;
for (int i = 0; i <= arrLength; ++i)
for (int j = 0; j <= sArr[i].size(); ++j)
int count = 0;
for (int i = 0; i < arrLength; ++i)
for (int j = 0; j < sArr[i].size(); ++j)
// if the jth char of the string is the specific char
if (sArr[i][j] = specificChar)
if (sArr[i][j] == specificChar)
count++;
return count;
}
Expand Down
6 changes: 3 additions & 3 deletions 3.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include<stdio.h>
#include<stdlib.h>
#include<cstdio>
#include<cstdlib>
#define MAX_SIZE 200
int arr[MAX_SIZE];

Expand Down Expand Up @@ -97,7 +97,7 @@ int average()
return sum / count;
}

void main()
int main()
{
int cmd;
long long int x;
Expand Down
2 changes: 1 addition & 1 deletion 4.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include<stdio.h>
#include<cstdio>
int main()
{
float arr[5] = { 12.5, 10.0, 13.5, 90.5, 0.5 };
Expand Down
5 changes: 3 additions & 2 deletions 5.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include<stdio.h>
#include<cstdio>
int main()
{
int arr[] = { 10, 20, 30, 40, 50, 60 };
Expand All @@ -7,4 +7,5 @@ int main()
printf("%d\n", (*ptr2 - *ptr1));
printf("%c", (char)(*ptr2 - *ptr1));
return 0;
}
}
// 78.000000
3 changes: 2 additions & 1 deletion 6.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include<stdio.h>
#include<cstdio>
int main()
{
int a;
Expand All @@ -9,3 +9,4 @@ int main()
printf("%d\n", a);
return 0;
}
//513
5 changes: 3 additions & 2 deletions 7.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include<stdio.h>
#include<cstdio>
int main()
{
int arr[] = { 1, 2, 3, 4, 5 };
Expand All @@ -7,4 +7,5 @@ int main()
p += 2;
printf("%d", *p);
return 0;
}
}
// 3
5 changes: 2 additions & 3 deletions 8.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include<stdio.h>
#include<cstdio>
const char * f(const char **p) {
auto q = (p + sizeof(char))[1];
return q;
Expand All @@ -8,6 +8,5 @@ int main() {
printf("%c%c ", *f(str), *(f(str) + 1));
printf("%c%c%c%c\n", **str, *(*(str + 1) + 1), *((str + 2)[-1] + 1), **&*(&str[-1] + 1));



}
//Be WooW
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.21)
project(ApLabGitPractice)

set(CMAKE_CXX_STANDARD 14)

add_executable(ApLabGitPractice
1.cpp
2.cpp
3.cpp
4.cpp
5.cpp
6.cpp
7.cpp
8.cpp)
Empty file.
Empty file.
Empty file.
Empty file.
Loading