From 14b52adb7c4476ef456f75165c790660081b28ec Mon Sep 17 00:00:00 2001 From: Sam 'snaens' Pelz Date: Thu, 26 Mar 2026 12:59:32 +0100 Subject: [PATCH] Add clion files to gitignore + Add clang-format --- .clang-format | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- 01/bmi.c | 18 +++++++++++++--- 3 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..0cdad67 --- /dev/null +++ b/.clang-format @@ -0,0 +1,57 @@ +--- +Language: Cpp +BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignOperands: true +AlignTrailingComments: false +AlwaysBreakTemplateDeclarations: Yes +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBraces: Custom +BreakConstructorInitializers: AfterColon +BreakConstructorInitializersBeforeComma: false +ColumnLimit: 240 +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ContinuationIndentWidth: 8 +IncludeCategories: + - Regex: '^<.*' + Priority: 1 + - Regex: '^".*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IndentCaseLabels: true +IndentWidth: 4 +InsertNewlineAtEOF: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: All +SpaceAfterCStyleCast: true +SpaceAfterTemplateKeyword: false +SpaceBeforeRangeBasedForLoopColon: false +SpaceInEmptyParentheses: false +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +TabWidth: 4 +... diff --git a/.gitignore b/.gitignore index ca97190..ac28b6a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.zip *.exe -*.o \ No newline at end of file +*.o +.idea/ \ No newline at end of file diff --git a/01/bmi.c b/01/bmi.c index dcf30aa..f529681 100644 --- a/01/bmi.c +++ b/01/bmi.c @@ -1,4 +1,16 @@ /************************************************************************************************* - * Schreiben Sie ein Programm, das das Gewicht in kg und die Groesse in cm einliest und dann den * - * Body Mass Index mit zwei Nachkommastellen ausgibt (bmi = gewicht / (groesse in m)²). * - *************************************************************************************************/ \ No newline at end of file + * Schreiben Sie ein Programm, das das Gewicht in kg und die Groesse in cm + * einliest und dann den * Body Mass Index mit zwei Nachkommastellen ausgibt + * (bmi = gewicht / (groesse in m)²). * + *************************************************************************************************/ + +#include + +int main() { + unsigned int gewicht_kg = 0; + unsigned int groesse_m = 0; + + scanf("gewicht: %i\n", &gewicht_kg); + printf("gewicht: %i\n", gewicht_kg); + return 0; +}